Snowplow Micro 1.2 released

Share

We are very happy to announce the v1.2 release of Snowplow Micro! We detail the changes and new features, along with examples, below.

This release adds the appropriate CORS headers on Micro’s HTTP responses, which means that there are no longer cross-origin restrictions when hitting Micro’s endpoints.

In addition, Embedded Iglu capabilities have been added. Users have now the option to embed their custom schemas during their test workflows.

Furthermore, Snowplow Micro now features a new REST API endpoint: /micro/iglu, that can be used for schema lookup.

Also, starting from version 1.2, Snowplow Micro Docker images are built with multi-architecture support and can now run on ARM devices as well.

Finally, this release includes updates to library dependencies, including the Stream Collector and Enrich libraries, and a bugfix concerning the error response in case of adapter failures.

Read on below for:

  1. Micro’s CORS Headers
  2. Embedding custom schemas
  3. Schema lookup
  4. ARM support
  5. Migrating from previous version
  6. Documentation and help

Micro’s CORS Headers

Before release v1.2 it was not possible to hit the Micro’s REST API endpoints from a browser as the appropriate CORS headers were missing.

With release v1.2 browsers should now permit hitting Micro’s endpoints from a web application without cross-origin restrictions, while OPTIONS has become one of the supported HTTP methods:

Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

Embedding custom schemas

Snowplow Micro now allows the schemas that your test workflows depend on to also be embedded, rather than having to be uploaded into a separate schema registry.

In order to do so, users simply need an iglu-client-embedded directory (templated as an Iglu repository) under the same directory that is mounted when starting Micro. For example, assuming a directory structure as:

example
├── iglu-client-embedded
│   └── schemas
│       └── com.myvendor
│           └── myschema
│               └── jsonschema
│                   └── 1-0-0
├── iglu.json
└── micro.conf

then, it is enough, without any change to Micro’s Iglu resolver configuration to run the usual docker run command to spin Micro up with the custom schemas embedded in:

docker run --mount type=bind,source=$(pwd)/example,destination=/config \
  -p 9090:9090 \
  snowplow/snowplow-micro:1.2.1 \
  --collector-config /config/micro.conf \
  --iglu /config/iglu.json

This is also possible for users who cannot use Docker by using the published jar asset in GitHub releases, as:

# Unix users
java -cp snowplow-micro-1.2.1.jar:example com.snowplowanalytics.snowplow.micro.Main --collector-config example/micro.conf --iglu example/iglu.json
# Windows users
java -cp snowplow-micro-1.2.1.jar;example com.snowplowanalytics.snowplow.micro.Main --collector-config example/micro.conf --iglu example/iglu.json

You can see an actual working example test workflow using this new capability of Micro under the latest release of the snowplow-micro-examples repository.

Schema lookup

It is now possible for users to check whether a schema can be resolved by using the new /micro/iglu REST API endpoint that was introduced in v1.2.

Schema lookup should be in format:

/micro/iglu/{vendor}/{schemaName}/jsonschema/{schemaVersion}

For example:

curl -X GET http://localhost:9090/micro/iglu/com.myvendor/myschema/jsonschema/1-0-0

ARM support

Previously, users running on ARM architectures (e.g. Apple Silicon or Raspberry Pi) could only run Micro using Java.

With the v1.2 release, Snowplow Micro’s Docker images fully support arm64 devices, since they are built with multi-architecture support. Both amd64 and arm64 users can use the exact same commands to run Micro as a Docker container.

Migrating from previous version

There is no breaking change in v1.2.

Snowplow Micro is published on docker hub. You simply need to update your docker commands to pull the latest version, 1.2.1, and then explore all the new features!

docker pull snowplow/snowplow-micro:1.2.1

Documentation and help

Information about how to set up and use Snowplow Micro can be found here. If you have any questions or run into any problems, please visit our Discourse forum.

Feedback and contributions are always welcome – if you have identified a bug, please log an issue on GitHub.

Share

Related articles