Skip to content

Instantly share code, notes, and snippets.

@kpettijohn
Last active January 28, 2019 17:13
Show Gist options
  • Save kpettijohn/d4ee96ef7bd03c8040ffd2b952b8608c to your computer and use it in GitHub Desktop.
Save kpettijohn/d4ee96ef7bd03c8040ffd2b952b8608c to your computer and use it in GitHub Desktop.
Testing alerts with Alertmanager
[
{
"labels": {
"alertname": "ServiceHighRequestLatency",
"region": "useast2",
"job": "blackbox",
"protocol": "https",
"service": "www",
"instance": "https://www.example.com"
},
"annotations": {
"info": "Probes originating from useast2 have an average request latency above 4s (current value: TEST)",
"summary": "HighRequestLatency on www"
}
},
{
"labels": {
"alertname": "ServiceHighRequestLatency",
"region": "uswest2",
"job": "blackbox",
"protocol": "https",
"service": "www",
"instance": "https://www.example.com"
},
"annotations": {
"info": "Probes originating from useast2 have an average request latency above 4s (current value: TEST)",
"summary": "HighRequestLatency on www"
}
}
]
URL="http://127.0.0.1:9093"
alert=$(cat alert.json)
curl -XPOST -d"$alert" $URL/api/v1/alerts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment