Skip to content

Instantly share code, notes, and snippets.

@nvolungis
Last active March 26, 2020 18:25
Show Gist options
  • Save nvolungis/56d863c7a848bd6d4bfb4b809555634c to your computer and use it in GitHub Desktop.
Save nvolungis/56d863c7a848bd6d4bfb4b809555634c to your computer and use it in GitHub Desktop.
basic ingestion spec for flat player events
{
"type": "kafka",
"ioConfig": {
"consumerProperties": {
"bootstrap.servers": "kafka:19092"
},
"topic": "stats_tap.flat_player_event.proto.v0",
"type": "kafka",
"taskCount": 1,
"replicas": 1
},
"tuningConfig": {
"type": "kafka"
},
"dataSchema": {
"dataSource": "stats_tap.flat_player_event.proto.v0",
"parser": {
"type": "protobuf",
"descriptor": "https://wistia-analytics-archive.s3.us-east-1.amazonaws.com/protobuf/schema.desc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQAZE5UZCUKCLCANK%2F20200326%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200326T171851Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Security-Token=FwoGZXIvYXdzEKn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDI%2BorB4uhCwBelinGCKEASDiTPia0acp%2Fe9AUJs7EhhsiolVWFfdR9FL2jp5rvv0LlC0U6bsJBpRJDj6JuqjPGuFmlVq0bzyKWpLIHVbqXBaH188yo%2B9HJtQIsw3KrRvZFK2TT7glvb4AvwuwTNjgk8GjYigKr%2Fl8uIJ3bdQYGumJuIo72A7uIJIFz4yrDtgGCFZcijdj%2FPzBTIpzfjgAzcAD7YCuJ1J%2Fnna%2BYoeKJUBKawZD9viGfKResrRrgOE5sPFL1o%3D&X-Amz-Signature=ffe405aa1211d4094a7f9eb1065fb5662cf31f711ff44faa0a52862c015e9b78",
"protoMessageType": "FlatPlayerEvent",
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "timestamp",
"format": "auto",
"missingValue": "2010-01-01T00:00:00Z"
},
"dimensionsSpec": {
"dimensions": [
"account_key",
"action.category",
"action.key",
"action.text",
"action.type",
"action.uniqueToVisitor",
"caption.caption_key",
"caption.enabled",
"caption.language",
"conversion_data.converted",
"conversion_data.email",
"conversion_data.first_name",
"conversion_data.last_name",
"conversion.co_key",
"conversion.co_type",
"conversion.converted",
"conversion.email",
"conversion.first_name",
"conversion.last_name",
"conversion.link",
"correlation_id",
"event_key",
"ip",
"isUnique",
"key",
"media_id",
"media_type",
"project_hashed_id",
"referrer",
"session_id",
"user_agent",
"utm_params.campaign",
"utm_params.medium",
"utm_params.source"
]
},
"flattenSpec": {
"fields": [
{
"name": "action.category",
"type": "path",
"expr": "$.action.category"
},
{
"name": "action.key",
"type": "path",
"expr": "$.action.key"
},
{
"name": "action.text",
"type": "path",
"expr": "$.action.text"
},
{
"name": "action.time",
"type": "path",
"expr": "$.action.time"
},
{
"name": "action.type",
"type": "path",
"expr": "$.action.type"
},
{
"name": "action.uniqueToVisitor",
"type": "path",
"expr": "$.action.uniqueToVisitor"
},
{
"name": "caption.caption_key",
"type": "path",
"expr": "$.caption.caption_key"
},
{
"name": "caption.enabled",
"type": "path",
"expr": "$.caption.enabled"
},
{
"name": "caption.language",
"type": "path",
"expr": "$.caption.language"
},
{
"name": "caption.time",
"type": "path",
"expr": "$.caption.time"
},
{
"name": "conversion.co_key",
"type": "path",
"expr": "$.conversion.co_key"
},
{
"name": "conversion.co_type",
"type": "path",
"expr": "$.conversion.co_type"
},
{
"name": "conversion.converted",
"type": "path",
"expr": "$.conversion.converted"
},
{
"name": "conversion.email",
"type": "path",
"expr": "$.conversion.email"
},
{
"name": "conversion.first_name",
"type": "path",
"expr": "$.conversion.first_name"
},
{
"name": "conversion.last_name",
"type": "path",
"expr": "$.conversion.last_name"
},
{
"name": "conversion.link",
"type": "path",
"expr": "$.conversion.link"
},
{
"name": "conversion.time",
"type": "path",
"expr": "$.conversion.time"
},
{
"name": "conversion_data.converted",
"type": "path",
"expr": "$.conversion_data.converted"
},
{
"name": "conversion_data.email",
"type": "path",
"expr": "$.conversion_data.email"
},
{
"name": "conversion_data.first_name",
"type": "path",
"expr": "$.conversion_data.first_name"
},
{
"name": "conversion_data.last_name",
"type": "path",
"expr": "$.conversion_data.last_name"
},
{
"name": "utm_params.campaign",
"type": "path",
"expr": "$.utm_params.campaign"
},
{
"name": "utm_params.medium",
"type": "path",
"expr": "$.utm_params.medium"
},
{
"name": "utm_params.source",
"type": "path",
"expr": "$.utm_params.source"
}
]
},
"granularitySpec": {
"type": "uniform",
"queryGranularity": "HOUR",
"segmentGranularity": "HOUR",
"rollup": true
},
"metricsSpec": [
{
"name": "count",
"type": "count"
},
{
"name": "sum_action.time",
"type": "longSum",
"fieldName": "action.time"
},
{
"name": "sum_caption.time",
"type": "longSum",
"fieldName": "caption.time"
},
{
"name": "sum_conversion_type",
"type": "longSum",
"fieldName": "conversion_type"
},
{
"name": "sum_conversion.time",
"type": "longSum",
"fieldName": "conversion.time"
},
{
"name": "sum_endBucket",
"type": "longSum",
"fieldName": "endBucket"
},
{
"name": "sum_received_at",
"type": "longSum",
"fieldName": "received_at"
},
{
"name": "sum_startBucket",
"type": "longSum",
"fieldName": "startBucket"
},
{
"name": "sum_timeDelta",
"type": "longSum",
"fieldName": "timeDelta"
},
{
"name": "sum_visitor_version",
"type": "longSum",
"fieldName": "visitor_version"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment