Anomaly Alert Webhook Formats

DESCRIPTION 

Structure of an anomaly alert object returned by Anodot webhook channels.

Anodot supports Metric 2.0 [recommended] and Metric 1.0 [legacy] formats. See Metric Naming Conventions for details about the differencenve between the two formats.

Notes:

  • Epoch time is always in seconds (UTC time).
  • The alert templates show the structure (with iterators if a number of metrics and alerts descriptions are combined to the same alert message).

ANOMALY ALERT TEMPLATE 
METRIC 2.0 EXAMPLE
METRIC 1.0 EXAMPLE

ANOMALY ALERT TEMPLATE

{
"subject": "{{subject}}",
"severity": "{{severity}}",
"description": "{{description}}",
"investigationUrl":” {{The link to the Anoboard}}",
"startTime": "{{startTime}} (UTC)",
"startTimeEpoch": "{{startTimeEpoch}}",
"alerts": [
{{#alerts}}
    {
    "title": "{{title}}",
    "metrics": [
    {{#each metrics}}
        {
        "duration": "{{duration}}",
        "durationInSeconds": "{{durationInSeconds}}",
        "startTime": "{{startTime}} (UTC)",
        "startTimeEpoch": "{{startTimeEpoch}}",
        "imageUrl": "{{imageUrl}}",
        "peak": "{{peak}}",
        "direction": "{{direction}}",
        "delta": {{delta}},
         "significance" : {{score}},
        "name": "{{name}}",
        "state": "{{state}}"
        }
    {{/each}}
    ],
"events":{
"Total":"{{total Events}}",
"buckets":[
{{#if events}}
   {{#each events}}
       {
       "date":"{{date}}",
       "Total":"{{total events in aggregation}}",
       "topEvents":[
       {{#each topEvents}}
           {
           "title" :"{{title}}",
           "description" :"{{description}}",
           "source" :"{{source}}",
           "category" : "{{category}}",
           "startDate" :"{{startDate}}",
           "endDate" : "{{endDate}}"
           }
         {{/each}}
       ]
       }
   {{/each}}
{{/if}}
]
},
    "alertId": "{{alertId}}",
    "alertSettingsUrl": "{{The link to the alert’s setting}}",
    "description": "{{description}}",
    "severity": "{{severity}}"
    }{{/alerts}}
]
}

METRIC 2.0 EXAMPLE (WITH MULTIPLE METRICS]

{
 {
  "subject": "Alert Open: Sample Anomaly Alert 1448200156553[critical][44d4c]",
  "severity": "critical",
  "description": "Sample anomaly Alert with multiple metrics",
  "investigationUrl": "https://app.staging.anodot.com/#!/anomalies/board?anomalies=main;44d4ce047bb5d300d7a94cec63e30cad&activeTab=1&duration=
1;1&durationScale=minutes;minutes&delta=1;1&deltaType=percentage;
percentage&resolution=short;short&alertId=;cfcb5a94-ba91-4128-8002-990b15c85eed&score=0;0&state=both;both&direction=both;both&sort=startDate;
startDate&constRange=1h;1h&q='
'",
  "startTime": "11/21/2016 15:17:00 (UTC)",
  "startTimeEpoch": "1479741360",
  "alerts": [
    {
      "title": "Metric sample 1 1479822556553",
      "metrics": [
        {
          "duration": "1m",
          "durationInSeconds": "60",
          "startTime": "11/21/2016 15:17:00 (UTC)",
          "startTimeEpoch": "1479741360",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:cfcb5a94-ba91-4128-8002-990b15c85eede:40eeba9f5b9098a2135ed7568cec71b4.png",
          "peak": "500.0000",
          "direction": "UP",
          "delta": 1000,
          "significance": 84,
          "name": "what=total_sales.country=us.device=mobile.source=db.state=ca.1479822556553",
          "state": "OPEN"
        }
      ],
      "events": {
        "total": "2",
        "buckets": [
          {
            "date": "1472626800",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample 1 Title",
                "description": "Sample 1 Description",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472626597",
                "endDate": "1472626597"
              }
            ]
          },
          {
            "date": "1472626200",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample 2 Title",
                "description": "Sample 2 Description",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472625982",
                "endDate": "1472625982"
              } 
          ]
          }
        ]
      },
      "alertId": "14a87e94-567e-4bd5-93d9-1e0112b92702",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/14a87e94-567e-4bd5-93d9-1e0112b92702",
      "description": "Sample anomaly Alert with multiple metrics",
      "severity": "critical"
    },
    {
      "title": "Metric Sample 2 1479822540553",
      "metrics": [
        {
          "duration": "12m",
          "durationInSeconds": "720",
          "startTime": "11/21/2016 15:17:00 (UTC)",
          "startTimeEpoch": "1479822540",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:cfcb5a94-ba91-4128-8002-990b15c85eede:066a6923371fc91cc9db2a5a82367324.png",
          "peak": "-500.0000",
          "direction": "DOWN",
          "delta": 1000,
          "significance": 81,
          "name": "what=total_sales.country=us.device=mobile.source=db.state=ny. 1479822540553",
          "state": "OPEN"
        }
      ],
      "events": {
        "total": "2",
        "buckets": [
          {
            "date": "1472626800",
            "total": "1",
            "topEvents": [
              {
                "title": "Service D deployment Failed on saasweb1",
                "description": "deployment ID 426981",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472626597",
                "endDate": "1472626597"
              }
            ]
          },
          {
            "date": "1472626200",
            "total": "1",
            "topEvents": [
              {
                "title": "Service C deployment Success on off1",
                "description": "deployment ID 389870",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472625982",
                "endDate": "1472625982"
              }
            ]
          }
        ]
      },
      "alertId": "c417f6f5-8f5b-4ea6-970c-f2499619f1a8",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/c417f6f5-8f5b-4ea6-970c-f2499619f1a8",
      "description": "should generate one alert story with DAL1 contains metrics m1(up) and DAL2 contains metrics m4(down)",
      "severity": "critical"
    }
  ]
}

METRIC 1.0  EXAMPLE (WITH MULTIPLE METRICS)

{
 {
  "subject": "Alert Open: Sample Anomaly Alert 1448200156553[critical][44d4c]",
  "severity": "critical",
  "description": "Sample anomaly Alert with multiple metrics",
  "investigationUrl": "https://app.staging.anodot.com/#!/anomalies/board?anomalies=main;44d4ce047bb5d300d7a94cec63e30cad&activeTab=1&duration=
1;1&durationScale=minutes;minutes&delta=1;1&deltaType=percentage;
percentage&resolution=short;short&alertId=;cfcb5a94-ba91-4128-8002-990b15c85eed&score=0;0&state=both;both&direction=both;both&sort=startDate;
startDate&constRange=1h;1h&q='
'",
  "startTime": "11/21/2016 15:17:00 (UTC)",
  "startTimeEpoch": "1479741360",
  "alerts": [
    {
      "title": "Metric sample 1 1479822556553",
      "metrics": [
        {
          "duration": "1m",
          "durationInSeconds": "60",
          "startTime": "11/21/2016 15:17:00 (UTC)",
          "startTimeEpoch": "1479741360",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:cfcb5a94-ba91-4128-8002-990b15c85eede:40eeba9f5b9098a2135ed7568cec71b4.png",
          "peak": "500.0000",
          "direction": "UP",
          "delta": 1000,
          "significance": 84,
          "name": "total_sales.us.mobile.db.ca.1479822556553",
          "state": "OPEN"
        }
      ],
      "events": {
        "total": "2",
        "buckets": [
          {
            "date": "1472626800",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample 1 Title",
                "description": "Sample 1 Description",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472626597",
                "endDate": "1472626597"
              }
            ]
          },
          {
            "date": "1472626200",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample 2 Title",
                "description": "Sample 2 Description",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472625982",
                "endDate": "1472625982"
              } 
          ]
          }
        ]
      },
      "alertId": "14a87e94-567e-4bd5-93d9-1e0112b92702",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/14a87e94-567e-4bd5-93d9-1e0112b92702",
      "description": "Sample anomaly Alert with multiple metrics",
      "severity": "critical"
    },
    {
      "title": "Metric Sample 2 1479822540553",
      "metrics": [
        {
          "duration": "12m",
          "durationInSeconds": "720",
          "startTime": "11/21/2016 15:17:00 (UTC)",
          "startTimeEpoch": "1479822540",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:cfcb5a94-ba91-4128-8002-990b15c85eede:066a6923371fc91cc9db2a5a82367324.png",
          "peak": "-500.0000",
          "direction": "DOWN",
          "delta": 1000,
          "significance": 81,
          "name": "total_sales.us.mobile.db.ny.1479822540553",
          "state": "OPEN"
        }
      ],
      "events": {
        "total": "2",
        "buckets": [
          {
            "date": "1472626800",
            "total": "1",
            "topEvents": [
              {
                "title": "Service D deployment Failed on saasweb1",
                "description": "deployment ID 426981",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472626597",
                "endDate": "1472626597"
              }
            ]
          },
          {
            "date": "1472626200",
            "total": "1",
            "topEvents": [
              {
                "title": "Service C deployment Success on off1",
                "description": "deployment ID 389870",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472625982",
                "endDate": "1472625982"
              }
            ]
          }
        ]
      },
      "alertId": "c417f6f5-8f5b-4ea6-970c-f2499619f1a8",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/c417f6f5-8f5b-4ea6-970c-f2499619f1a8",
      "description": "should generate one alert story with DAL1 contains metrics m1(up) and DAL2 contains metrics m4(down)",
      "severity": "critical"
    }
  ]
}

 

Was this article helpful?
0 out of 0 found this helpful