Configuring enrichments
By default, Micro does not come with any enrichments enabled — this helps us keep the docker image smaller. You can enable any enrichments you like by passing corresponding configuration files to Micro.
Limitations for enrichments that rely on data files
For example, let’s say that you want to configure the IP Lookup enrichment. The default configuration file looks like this:
{
"schema": "iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/2-0-0",
"data": {
"name": "ip_lookups",
"vendor": "com.snowplowanalytics.snowplow",
"enabled": true,
"parameters": {
"geo": {
"database": "GeoLite2-City.mmdb",
"uri": "http://my-self-hosted-assets.example.com/third-party/maxmind"
}
}
}
}
Put this file somewhere on the machine where you are running Micro, let’s say my-enrichments/ip_lookups.json
. (Feel free to add any other configurations to my-enrichments
).
Now you will need to pass this directory to the Docker container (using a bind mount):
docker run -p 9090:9090 \
--mount type=bind,source=$(pwd)/my-enrichments,destination=/config/enrichments \
snowplow/snowplow-micro:2.2.0
The directory inside the container (what goes after destination=
) must be exactly /config/enrichments
.
Once Micro starts, you should see messages like these:
[INFO] com.snowplowanalytics.snowplow.micro.Run - Downloading http://snowplow-hosted-assets.s3.amazonaws.com/third-party/maxmind/GeoLite2-City.mmdb...
[INFO] com.snowplowanalytics.snowplow.micro.Run - Enabled enrichments: IpLookupsEnrichment
Micro is especially great for testing the JavaScript enrichment.