# UDP Event enricher

The UDP Event enricher is a service that runs in a Kubernetes cluster and processes all authenticated, valid Caliper event data. The Event enricher adds Context store-sourced data associated with an event, but that is not included in an event payload, to the internal message the carries the event payload. This enables forms of downstream processing not otherwise possible with the native data alone.

The UDP event enricher service is automatically installed and configured during the UDP installation process. The configuration includes automatically establishing the networking and user access necessary for the enricher to access Context store data.

## UDP ID enrichment <a href="#udpeventenricher-udpidenrichment" id="udpeventenricher-udpidenrichment"></a>

The primary form of event enrichment today is to add the UDP IDs for a Person and Course offering associated with their correlates in the event to the internal message carrying that event payload.

For example, suppose a Caliper event from Learning tool A hits the UDP Caliper endpoint and is authenticated and validated. The event is given to the UDP Event enricher, which extracts from the event payload the native Person identifier of "456" from Learning tool A. The Enricher looks up the UDP Person ID for identifier 456 for Learning tool A in a cache of the UDP Person keymap, identifying it as "1111". The UDP Enricher then adds this UDP Person ID to the message carrying the event

<figure><img src="https://3709019308-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKYwtHNGgdPXS3PWAlZUr%2Fuploads%2Fgit-blob-824863b2d7ddfbb27323c2ff391deb8b23d561fd%2F20448003.png?alt=media" alt=""><figcaption></figcaption></figure>

*A depiction of simple enrichment. The UDP ID for the Person is added to the message accompanying the Caliper event payload.*

The advantage of enriching events with their UDP IDs is that it enables the clean, consistent downstream association of Behavior data with Context data. By sharing common identifies, both classes of data can be joined, analyzed, and reported in an easy, consistent fashion.

At present, the UDP will *always* seek to enrich *every* Caliper event with a UDP Person ID and UDP Course offering ID.

## Label enrichment <a href="#udpeventenricher-labelenrichment" id="udpeventenricher-labelenrichment"></a>

In theory, events can be enriched with any data sourced in the Context data. For example, in addition to enriching an event with a UDP Person ID, it may also be useful to enrichment the event with the Person `first_name` and `last_name` elements. These elements are "labels" associated with the UDP identifiers.

Enriching events with labels can be useful for various kinds of use-cases. For example, if you're computing metrics in real-time using event stream data, it may be required to use data elements that are available in the Context store but not in the Behavioral data. Suppose that you're trying to compute, in real-time, the score a student achieved on an assignment as a percentage but you only have the score in the event data and not the total number of possible points that can be earned. The "points possible" for the assignment may be in the Context store, in which case it must be fetched in order to compute the percentage.

Configurable, arbitrary label enrichment is not yet supported by the UDP. At present, label enrichment is hard-coded into a few processes designed to support data marts.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.unizin.org/products/data-and-analytics/unizin-data-platform/system-overview/event-data-pipeline/udp-event-enricher.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
