I’m trying to set up automated tests for a website to Snowplow Micro. The website is a simple webpage with some text and a form that prompts the user to submit their name. Currently, events such as form submissions, link clicks, and page pings are being successfully sent and enriched by Snowplow.
I want to use a custom schema that would mark an event as ‘bad’ if the name submitted is under 5 characters. I think I was able to add this to the schema registry because when I run curl --request GET --header "apikey:<MY_API_KEY>" <URL_TO_SCHEMA_REGISTRY/schemas>
, my output shows me the custom schemas I made.
To add this custom schema, I updated my iglu.json
file to include
{
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-2",
"data": {
"cacheSize": 500,
"cacheTtl": 600,
"repositories": [
{
"connection": {
"http":{
"uri":"http://iglucentral.com"
}
},
"name": "Iglu Central",
"priority":10,
"vendorPrefixes":[]
},
{
"connection": {
"http":{
"apikey":"MY_API_KEY",
"uri":"URL_TO_SCHEMA_REGISTRY"
}
},
"name":"SCHEMA_REGISTRY_NAME",
"priority":0,
"vendorPrefixes":["com.MY_VENDOR_NAME"]
}
]
}
}
And under the same directory that is mounted when starting Micro, I have the following directory structure:
With the following code in my 1-0-0 file:
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for an username changed event",
"self": {
"vendor": "com.MY_VENDOR_NAME",
"name": "username_changed",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"username": {
"description": "Identifier for user",
"type": "string",
"minLength": 5,
"maxLength": 255
}
},
"additionalProperties": false,
"required": [
"username"
]
}
When I run Snowplow Micro on docker with docker run --mount type=bind,source=$(pwd)/example,destination=/config -p 9090:9090 snowplow/snowplow-micro:1.3.0 --collector-config /config/micro.conf --iglu /config/iglu.json
and use cat
on /config/iglu.json
, I see the iglu.json
file I’ve written above.
However, since adding this new schema, seemingly nothing has changed. Even when I type in a username under 5 characters, no bad events are created. Further, using the Poplin Data Snowplow Chrome extension, I’m unable to find the custom schema I created under the “Manage Schemas” tab. Any assistance would be greatly appreciated, and I’m happy to provide additional details if needed!
Thanks so much!