Event enrichments allow you to create additional attributes or dimensions that are not part of the original event schema payload. You can compute a new value using a formula in jsonLogic syntax and use that for further metering.
There are 2 parts to an enrichment -
- Field type - You can define if the enrichment should be an attribute or a dimension as part of the enriched event schema.
- Enrichment type and value - You can define if the enrichment is a static value or a computed dynamic value based on a custom formula. The formula is given in the form of jsonLogic syntax. Using this, you can build complex rules and create additional variables (attribute or dimension) and enrich the ingested event.
- Dependencies - Dependencies are variables that you can define which are not part of the original event schema. These can be static values or dynamic values take from other settings within Togai.
Creating an event enrichment
Let’s continue with the example used while creating an event schema. Here, we need to compute the performance value which is dependent on the read and write rates. Let’s take the case where read_rate and write_rate should be added together to determine the total GBps for performance billing.
In this case, since both the variables in the computation are part of the schema, we do not have to define a separate dependency. We can directly define an attribute enrichment that adds the read and write rates from the schema.
Example of an event enrichment