Static Alert Threshold Webhook Formats

DESCRIPTION 

Structure of a static alert threshold 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 difference between the two formats.

Notes:

  • Contact Anodot Support to whitelist IP addresses when setting up webhooks
  • 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).

STATIC ALERT THRESHOLD TEMPLATE 
METRIC 2.0 EXAMPLE
METRIC 1.0 EXAMPLE

STATIC ALERT THRESHOLD TEMPLATE

{
"subject": "{{subject}}",
"severity": "{{severity}}",
"description": "{{description}}",
"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}}",
        "name": "{{name}}",
        "state": "{{state}}",
        "threshold": {{threshold}}
        }
    {{/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

{
  "subject": "Alert Close: Static Alert Sample 1479763487178[critical][fcc7a]",
  "severity": "critical",
  "description": “Sample Static Alert”,
  "startTime": "11/19/2016 22:27:00 (UTC)",
  "startTimeEpoch": "1479594420",
  "alerts": [
    {
      "title": "“Static Alert Sample 1479763487178",
      "metrics": [
        {
          "duration": "16h 42m",
          "durationInSeconds": "60120",
          "startTime": "11/19/2016 22:27:00 (UTC)",
          "startTimeEpoch": "1479594420",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:04410c3e-9364-46d2-9db5-c71777429254e:7d70fa50f1f0060f2e1176c5d207eb1b.png",
          "peak": "1000.0000",
          "direction": "UP",
          "name": "what=total_sales.country=us.device=mobile.source=db.state=ca.1448141087178",
          "state": "CLOSED",
          "threshold": 500
        }
      ],
      "events": {
        "total": "2",
        "buckets": [
          {
            "date": "1472626800",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample event 1",
                "description": "Event 1",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472626597",
                "endDate": "1472626597"
              }
            ]
          },
          {
            "date": "1472626200",
            "total": "1",
            "topEvents": [
              {
                "title": "Sample Event 2",
                "description": "Event 2",
                "source": "jenkins",
                "category": "deployments",
                "startDate": "1472625982",
                "endDate": "1472625982"
              }
            ]
          }
        ]
      },
      "alertId": "fcc7a04e-b9ac-413f-841d-8c69ba24b384",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/fcc7a04e-b9ac-413f-841d-8c69ba24b384",      "description": "Sample Static Alert",
      "severity": "critical"
    }
  ]
}
 

METRIC 1.0 EXAMPLE

{
  "subject": "Alert Close: Static Alert Sample 1479763487178[critical][fcc7a]",
  "severity": "critical",
  "description": “Sample Static Alert”,
  "startTime": "11/19/2016 22:27:00 (UTC)",
  "startTimeEpoch": "1479594420",
  "alerts": [
    {
      "title": "“Static Alert Sample 1479763487178",
      "metrics": [
        {
          "duration": "16h 42m",
          "durationInSeconds": "60120",
          "startTime": "11/19/2016 22:27:00 (UTC)",
          "startTimeEpoch": "1479594420",
          "imageUrl": "https://alert-images-staging.s3.amazonaws.com/i:04410c3e-9364-46d2-9db5-c71777429254e:7d70fa50f1f0060f2e1176c5d207eb1b.png",
          "peak": "1000.0000",
          "direction": "UP",
          "name": "total_sales.us.mobile.db.ca.1448141087178",
          "state": "CLOSED",
          "threshold": 500
        }
      ],
      "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": "fcc7a04e-b9ac-413f-841d-8c69ba24b384",
      "alertSettingsUrl": "https://app.staging.anodot.com/#!/alert/fcc7a04e-b9ac-413f-841d-8c69ba24b384",      "description": "Sample Static Alert",
      "severity": "critical"
    }
  ]
}
 

 

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