Skip to main content

Custom webhooks: metric alerts

Send metric alert notifications to a custom outbound webhook, for example a chat channel or an external system, instead of, or alongside, Coralogix-native routing. Use this when a metric alert needs to reach a destination you drive through a generic webhook payload.

Custom webhooks attach to a metric alert on the Response step of the alert creation wizard. The webhook-specific setup is below; for the rest of the wizard, see Configuring an alert definition.

What you need​

Attach a custom webhook​

To add a custom webhook to a metric alert, go to Alerts, then select Create alert (or open an existing metric alert). On the Response step of the wizard:

  1. Under Notify on, select Alerts.
  2. Turn on Webhooks, the section marked Legacy next to Custom notifications, and select your webhook. The Webhooks toggle works independently, so you can send to a webhook with Custom notifications off.

You can attach more than one webhook to drive several destinations from a single alert.

Group-by behavior​

How notifications map to webhook payloads depends on whether the alert uses Group by in the Condition section:

  • Trigger a single notification when at least one combination of the group-by values meets the condition. One notification aggregates all matching values.
  • Trigger a separate notification for each combination that meets the condition. Select one or more keys, a subset of the fields used in the alert condition, and a separate notification is sent for each key.
  • To populate the $GROUP_BY_VALUE_1 placeholder in the webhook payload, the metric must be grouped by that field.
  • The number of Group by permutations is limited to 1000. When more exist, only the first 1000 are tracked.

When no Group by is set, a single notification is sent when the query meets the condition.

Notification cadence​

  • Notify every: sets the cadence. After a notification is sent, the alert keeps evaluating, but notifications are suppressed for the duration of the period.
  • Notify when resolved: sends a follow-up notification after the condition clears.

Next steps​

Configure metric threshold-based alerting in Threshold alerts.

Last updated on