Snowplow .NET Analytics SDK 0.1.0 released
This SDK has been developed as a first step towards our RFC, Porting Snowplow to Microsoft Azure. Over time, we expect this SDK will be used for tasks such as:
- Performing event data modeling in Azure Data Lake Analytics
- Performing analytics-on-write in Azure Functions as part of an Event Hubs-based real-time pipeline
- Writing real-time decisioning engines on Snowplow event streams in Microsoft Orleans:
Read on below the jump for:
Snowplow’s enrichment process outputs enriched events in a TSV format. This TSV currently has 131 fields, some of which are complex heterogeneous self-describing JSON, which can make it difficult to work with directly.
The Snowplow .NET Analytics SDK currently supports one transformation: the JSON Event Transformer, for turning this TSV into a more tractable JSON. Let’s check this out next.
2. The JSON Event Transformer
The JSON Event Transformer uses the exact same algorithm as that found in the Snowplow Scala Analytics SDK. Here is an excerpt from a generated JSON:
The most complex piece of processing is the handling of the self-describing JSONs found in the enriched event’s
derived_contexts fields. All self-describing JSONs found in the event are flattened into top-level plain (i.e. not self-describing) objects within the enriched event JSON.
For example, if an enriched event contained a
com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1, then the final JSON would contain:
The Snowplow .NET Analytics is published to NuGet, the .NET package manager. To add it to your project, install it in the Visual Studio Package Manager Console like so:
For more information on installation check out the .NET Analytics SDK setup guide.
Use the SDK like this:
If there are any problems in the input TSV (such as unparseable JSON fields or numeric fields), the
transform method will throw a
SnowplowEventTransformationException. This exception contains a list of error messages – one for every problematic field in the input.
For more information, please check out the .NET Analytics SDK technical documentation.
5. Getting help
And if there’s another Snowplow Analytics SDK you’d like us to prioritize creating, please let us know on our Discourse!