Alertmanager Event Source
The Alertmanager Integration for Signals allows users to create events in FireHydrant from alerts in Alertmanager. Anytime Alertmanager sends an event to FireHydrant, we evaluate the event payload to see if it matches any rules configured by one of your teams. If there's a match, we’ll alert the team. Learn more about Alert Rules here.
Configuring an Alertmanager Webhook
- In FireHydrant, navigate to the Signals Sources page (Signals > Sources). Here, you’ll find a webhook URL you will use when creating a webhook in Alertmanager.
- In your Alertmanager config YAML file, add a webhook receiver for FireHydrant and use the URL from the previous step as the webhook config URL:
receivers:
- name: 'firehydrant-signals-webhook'
webhook_configs:
- url: https://signals.firehydrant.com/v1/transpose/alertmanager/{webhook_key}
- In any of your routes, you can now add your named receiver as part of the route. For example:
route:
receiver: firehydrant-signals-webhook
- After creating alerts that match your routes, confirm that FireHydrant received your webhook by visiting Alerting > Webhook Logs in the web app. You should see a new Signal created. You can open the drawer to see the full payload from Alertmanager.
Field Mappings
FireHydrant's Alertmanager transposer will map the following fields to FireHydrant's Events Data Model.
Alertmanager Parameter | FireHydrant Parameter |
---|---|
md5(payload.groupKey ) | idempotency_key - Specifically FireHydrant uses an MD5 hash of the groupKey parameter as the idempotency key |
payload.alerts[0].annotations.summary -OR- payload.receiver | summary - FireHydrant will check if there is a summary in the annotation of the first alert, otherwise we use the receiver name |
payload.alerts[0].annotations.description | body - FireHydrant will check to see if there is a description in the annotation of the first alert, otherwise the description will be empty |
payload.status | status - Open when status is "firing", otherwise Closed |
payload.alerts[0].generatorURL -OR- payload.externalURL | links - FireHydrant will check if there is a generatorURL parameter in the first alert, otherwise we will use the externalURL parameter |
payload.groupKey | annotations['alertmanager/groupKey'] |
payload.commonAnnotations | annotations['alertmanager/annotations-*'] - FireHydrant will take all the commonAnnotations and prepend alertmanager/annotations- to their keys before inserting them into the annotations object |
payload.commonLabels | annotations['alertmanager/labels-*'] - FireHydrant will take all the commonLabels and prepend alertmanager/labels- to their keys before inserting them into the annotations field |
payload.groupLabels | annotations['alertmanager/grouped-by-*'] - FireHydrant will take all the groupLabels and prepend alertmanager/grouped-by- to their keys before inserting them into the annotations field |
These mappings mean that an inbound webhook from Alertmanager with the following content
{
"version": "4",
"groupKey": "123456789",
"truncatedAlerts": 0,
"status": "firing",
"receiver": "Receiver String",
"groupLabels": {
"groupLabel1": "value1",
"groupLabel2": "value2"
},
"commonLabels": {
"commonLabel1": "value1",
"commonLabel2": "value2"
},
"commonAnnotations": {
"commonAnnotation1": "value1",
"commonAnnotation2": "value2"
},
"externalURL": "https://test-alermanager.io",
"alerts": [
{
"status": "firing",
"labels": {
"label1": "value1",
"label2": "value2"
},
"annotations": {
"summary": "This is a test alertmanager alert",
"description": "This is a longer description of a test alertmanager alert",
"annotation1": "value1",
"annotation2": "value2"
},
"startsAt": "2023-12-18T07:20:50.52Z",
"endsAt": "2023-12-18T07:20:50.52Z",
"generatorURL": "https://test-alermanager.io/generator",
"fingerprint": "28295wtbgwyrgb8731"
}
]
}
...will result in the following mapped Signal on FireHydrant:
{
"summary": "This is a test alertmanager alert",
"body": "This is a longer description of a test alertmanager alert",
"links": [
{
"href": "https://test-alermanager.io/generator",
"text": "Alertmanager Generator"
}
],
"idempotency_key": "25f9e794323b453885f5181f1b624d0b",
"annotations": {
"alertmanager/annotations-commonAnnotation1": "value1",
"alertmanager/annotations-commonAnnotation2": "value2",
"alertmanager/groupKey": "123456789",
"alertmanager/grouped-by-groupLabel1": "value1",
"alertmanager/grouped-by-groupLabel2": "value2",
"alertmanager/labels-commonLabel1": "value1",
"alertmanager/labels-commonLabel2": "value2"
},
"status": 0
}
Updated 16 days ago