diff --git a/docs/configuration/alertmanager-integration/coralogix_managed_prometheus.rst b/docs/configuration/alertmanager-integration/coralogix_managed_prometheus.rst index a9ff600b1..bf0c7a230 100644 --- a/docs/configuration/alertmanager-integration/coralogix_managed_prometheus.rst +++ b/docs/configuration/alertmanager-integration/coralogix_managed_prometheus.rst @@ -10,7 +10,10 @@ Send Alerts to Robusta This integration lets you send Coralogix alerts to Robusta. -To configure it: +You need to create two webhooks: one for firing alerts and one for resolved alerts. + +Common Configuration (for both webhooks) +----------------------------------------- 1. In the Coralogix site go to Data Flow, then Outbound Webhooks, and click ``Generic webhook``. 2. In the url insert: @@ -22,34 +25,45 @@ To configure it: 3. Select the Post Method. 4. In the Edit headers replace it with -.. code-block:: yaml +.. code-block:: json { "Content-Type": "application/json", "Authorization": "Bearer " # where token is ' ' } -5. In Edit body add -.. code-block:: yaml +Firing Alerts Webhook +--------------------- + +5. Configure this webhook to trigger on **firing** alerts (when alerts are triggered/started). +6. For the firing alerts webhook, in Edit body add: + +.. code-block:: json { "externalURL": "", - "groupKey": "{}/{}:{}", + "groupKey": "coralogix/alert:${ALERT_ID}", "version": "1", "status": "firing", "receiver": "robusta receiver", "alerts": [ { - "description": "$ALERT_DESCRIPTION", "status": "firing", - "endsAt": "$EVENT_TIMESTAMP_MS", - "startsAt": "$EVENT_TIMESTAMP_MS", + "startsAt": "$EVENT_TIMESTAMP_ISO", + "endsAt": "1970-01-01T00:00:00Z", "generatorURL": "$ALERT_URL", + "source": "Coralogix", + "description": "$ALERT_DESCRIPTION", + "fingerprint": "$ALERT_UNIQUE_IDENTIFIER", "annotations": {}, "labels": { "cluster_name": "MY_CLUSTER_NAME", # make sure to add your cluster name here for this webhook. Both "cluster" or "cluster_name" labels are also supported "alertname": "$ALERT_NAME", + "severity": "$EVENT_SEVERITY", + "application": "$APPLICATION_NAME", + "subsystem": "$SUBSYSTEM_NAME", + "team": "$TEAM_NAME", "alert_url": "$ALERT_URL" # Add any additional alert specific fields here # see here for more parameters https://coralogix.com/docs/alert-webhooks/#custom-alert-webhooks @@ -58,9 +72,53 @@ To configure it: ] } +7. Click the 'Test Config' button and check your robusta sink for a "Test configuration" alert. +8. Click Save + +Resolved Alerts Webhook +----------------------- + +9. Create a second webhook following steps 1-4 above with the same URL and headers. +10. Configure this webhook to trigger on **resolved** alerts (when alerts are resolved/ended). +11. For the resolved alerts webhook, in Edit body add: + +.. code-block:: json + + { + "externalURL": "", + "groupKey": "coralogix/alert:${ALERT_ID}", + "version": "1", + "status": "resolved", + "receiver": "robusta receiver", + "alerts": [ + { + "status": "resolved", + "startsAt": "$EVENT_TIMESTAMP_ISO", + "endsAt": "$EVENT_TIMESTAMP_ISO", + "generatorURL": "$ALERT_URL", + "source": "Coralogix", + "description": "$ALERT_DESCRIPTION", + "fingerprint": "$ALERT_UNIQUE_IDENTIFIER", + "annotations": {}, + "labels": { + "cluster_name": "MY_CLUSTER_NAME", # make sure to add your cluster name here for this webhook. Both "cluster" or "cluster_name" labels are also supported + "alertname": "$ALERT_NAME", + "severity": "$EVENT_SEVERITY", + "application": "$APPLICATION_NAME", + "subsystem": "$SUBSYSTEM_NAME", + "team": "$TEAM_NAME", + "alert_url": "$ALERT_URL" + } + } + ] + } + +12. Click the 'Test Config' button and check your robusta sink for a "Test configuration" alert. +13. Click Save -6. Click the 'Test Config' button and check your robusta sink for a "Test configuration" alert. -7. Click Save +.. note:: + Make sure to update the ``cluster_name`` value in both webhook bodies to match your cluster name. Both "cluster" or "cluster_name" labels are also supported. + For more parameters, see `Coralogix alert webhooks documentation `_. Configure Metric Querying