Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Latest commit

 

History

History
62 lines (52 loc) · 1.78 KB

File metadata and controls

62 lines (52 loc) · 1.78 KB

Cerberus Metrics Topic

This template creates a SNS topic that is used by various components to publish Cerberus metric. This topic must be created in each region that metrics are tracked in.

Messages

Messages should conform to the following json schema, where dimensions is a k,v map

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {},
    "id": "http://example.com/example.json",
    "properties": {
        "dimensions": {
            "additionalProperties": { "type": "string" },
            "id": "/properties/dimensions",
            "properties": {},
            "type": "object"
        },
        "metricKey": {
            "id": "/properties/metricKey",
            "type": "string"
        },
        "metricType": {
            "id": "/properties/metricType",
            "type": "string"
        },
        "metricValue": {
            "id": "/properties/metricValue",
            "type": "string"
        }
    },
    "required": [
        "metricKey",
        "metricValue",
        "dimensions",
        "metricType"
    ],
    "type": "object"
}

Example message

{
  "metricKey": "iam-auth-event",
  "metricValue": "1",
  "metricType": "counter",
  "dimensions": {
    "iam-principal-arn": "arn:aws:iam::123456789012:role/microservice-foo",
    "environment": "dev"
  }
}

Deploy

After configuring a global profile, you can simply run.

./gradlew cerberus-metrics-topic:multiRegionDeploySam --stacktrace

After deploying, you can get the topic arn as a CloudFormation export variable CerberusMetricsTopicARN in the regions you elected to deploy to.