Advanced usage
Adding custom Iglu resolver configuration
If you’d like to tweak the Iglu registries Micro uses, the priority between them, the cache sizes, etc, you can provide your own Iglu resolver configuration (iglu.json
).
If you are just looking to add custom schemas or connect to your private Iglu registry, check out Adding custom schemas for simpler ways to achieve that.
Pass your configuration file to the container (using a bind mount) and instruct Micro to use it:
docker run -p 9090:9090 \
--mount type=bind,source=$(pwd)/iglu.json,destination=/config/iglu.json \
snowplow/snowplow-micro:1.6.0 \
--iglu /config/iglu.json
That’s it. You can use the the API to check if Micro is able to reach your schemas (replace com.example
and my-schema
as appropriate).
curl localhost:9090/micro/iglu/com.example/my-schema/jsonschema/1-0-0
Adding custom collector configuration
If you’d like to tweak the collector configuration inside Micro, you can bring your own configuration file (micro.conf
).
Example
loading...
Pass your configuration file to the container (using a bind mount) and instruct Micro to use it:
docker run -p 9090:9090 \
--mount type=bind,source=$(pwd)/micro.conf,destination=/config/micro.conf \
snowplow/snowplow-micro:1.6.0 \
--collector-config /config/micro.conf
Exposing Micro to the outside world
Sometimes you might want to send events to Micro running on your machine from tracking code that isn’t running on your machine.
In this case, you will need a publicly accessible URL for your Micro to point the tracker to. The easiest way to achieve it is with a tool like ngrok or localtunnel.
After running Micro as above, you just need to expose the port:
- ngrok
- localtunnel
Sign up, download ngrok and follow the instructions to authenticate your client. Then run this command:
ngrok http 9090
You will see the publicly available URL in the output.
Install:
npm install -g localtunnel
Then run this command:
lt --port 9090
You will see the publicly available URL in the output. Before use, visit this URL in your web browser and click “Continue”.