Enrich 4.1.0 released

We are excited to release version 4.1.0 of Snowplow’s Enrich. This version brings new features and addresses 2 CVEs.

Cross Navigation Enrichment

In this version, we introduce new enrichment: Cross Navigation Enrichment. This enrichment will be able to parse the extended cross navigation format in _sp querystring parameter and attach the cross_navigation context to an event.

The _sp parameter can be attached by our Web (see cross-domain tracking) and mobile trackers and contains user, session and app identifiers (e.g., domain user and session IDs, business user ID, source app ID). The information to include in the parameters is configurable in the trackers. This is useful for tracking the movement of users across different apps and platforms.

The extended cross navigation format can be described by _sp={domainUserId}.{timestamp}.{sessionId}.{subjectUserId}.{sourceId}.{platform}.{reason}

More information about this enrichment can be found in here.

Multiple JS enrichments support

Starting with this version, it is possible to have multiple JS enrichments. This allows to implement new enrichments in JavaScript and easily add them to Enrich. Currently, the order in which they would run is not defined.

Passing an object of parameters to the JS enrichment

As mentioned above, we added support for multiple JS enrichments. This simplifies implementing custom enrichments in JavaScript and adding them to Enrich. However, most enrichments take parameters. To avoid having to change the JavaScript code (and re-encode it in base64) every time there is a parameter change, we’ve added capability to pass these parameters in the enrichment configuration.

You can pass these parameters in the enrichment configuration, for example:

{
    "schema": "iglu:com.snowplowanalytics.snowplow/javascript_script_config/jsonschema/1-0-1",
    "data": {
        "vendor": "com.snowplowanalytics.snowplow",
        "name": "javascript_script_config",
        "enabled": true,
        "parameters": {
            "script": "script",
            "config": {
                "foo": 3,
                "nested": {
                    "bar": "test"
                }
            }
        }
    }
}

The parameter object can be accessed in JavaScript enrichment code via the second parameter of the process function, for example:

function process(event, params) {
  event.setApp_id(params.nested.bar);
  return [];
}

Authentication with Azure Event Hubs using OAuth2 in Enrich Kafka

The new version of Enrich Kafka allows to authenticate with Azure Event Hubs using OAuth2. If you would like to use this authentication method with Azure Event Hubs, you don’t have to pass anything extra in the config. It is enough to remove security.protocol, sasl.mechanism and sasl.jaas.config properties from consumerConf and producerConf sections. Application sets the necessary properties with the required values by default.

Stopping publishing jar files

Starting with 4.1.0, we no longer publish jar files of the applications. If you are still using jar files to run the application, we recommend to switch to Docker. You can find the running instructions for Docker in the docs page of the respective component.

Upgrading to 4.1.0

If you are already running a recent version of Enrich, all you need to do is pull the newer version of the docker image:

docker pull snowplow/snowplow-enrich-pubsub:4.1.0
docker pull snowplow/snowplow-enrich-kinesis:4.1.0
docker pull snowplow/snowplow-enrich-kafka:4.1.0

Check out the Enrich documentation for the full guide on running and configuring the apps.

4 Likes

Great improvments! Some question regarding multiple JS enrichments:

  • will this be supported in the BDP console soon ?
  • What most likely has a better performance: one enrichments with multiplen operations (current state) or splitting the current enrichment into multiple dedicated enrichments (“one per operation”).
  • Will Snowplow Mini and Micro be updated soon to be able to test new enrichment features properly?

Hi @davidher_mann,

Great questions!

Mainly, this feature is ground work for us to start building some new enrichments and not have to update the Enrich codebase every time. We might add support for multiple JS enrichments in the Console in the future, but currently the goal is to use this to support new standard enrichments with pre-defined JS code. (Hence the ability to adjust the parameters separately.)

I cannot say we tested this, but in principle a single enrichment will be more efficient, because otherwise there is additional deserialization/serialization of JSON. Also, the fact that the order is not specifiable (yet?) might not allow you to split JS enrichments where the different code bits are not fully independent.

Yes!

1 Like