Skip to main content
To add your webhook to Metoro, go to the integrations page and click on the Add Webhook button. Fill in the details of the webhook and click on the Add Webhook button. Webhook Integration
  • Name (required): The name of the webhook
  • URL (required): The URL of the webhook. You can use template variables in the URL for dynamic values (see template variables section below)
  • HTTP Method: The HTTP method to use when sending the webhook. Default is POST
  • Headers: Additional headers to send with the webhook. If you are sending a POST request, Content-Type header is added by default with the value application/json. You can add more headers by clicking on the Add Header button.
  • Body Template (optional): If you would like to send a custom body with the webhook, you can use the body template. Leave empty to use the default JSON payload. You can use template variables in your webhook body (see template variables section below).

Template Variables

You can use the following template variables in both the webhook URL and body template:
  • $alert_name: The name of the alert
  • $alert_description: The description of the alert
  • $alert_uuid: The UUID of the alert definition
  • $alert_fire_uuid: The UUID of the specific alert fire instance
  • $alert_state: The state of the alert (either “firing” or “resolved”)
  • $deep_link: Direct link to view the alert details in Metoro
  • $environment: [Deprecated - use $attributes instead] Environment context of the alert. It’s set for Kubernetes and Log alerts only or if the alert has a group by with environment
  • $service: [Deprecated - use $attributes instead] The service associated with the alert. It’s set for Kubernetes and Log alerts only or if the alert has a group by with service.name/service_name/client.service.name/server.service.name.
  • $fired_at: Unix Timestamp when alert was fired
  • $resolved_at: Unix Timestamp when alert was resolved/recovered.
  • $breaching_datapoint_value: The last metric/trace value that triggered the alert. It’s set for Trace and Metric alerts only.
  • $breaching_datapoint_time: Unix Timestamp of the last breaching value. It’s set for Trace and Metric alerts only.
  • $metric_name: Name of the metric that triggered the alert. It’s set for Trace and Metric alerts only.
  • $attributes: List of attribute key and value pairs (in key: value format) for which the alert is firing. Only set when you use a group by in your alert.

Examples

URL Examples

You can include template variables directly in your webhook URL:
https://api.example.com/webhook?alert=$alert_name&value=$breaching_datapoint_value
https://api.example.com/alerts/$alert_uuid/fire/$alert_fire_uuid
https://api.example.com/webhook?state=$alert_state&service=$service

Body Template Examples

  1. JSON format:
{ 
  "alert": "$alert_name", 
  "alert_uuid": "$alert_uuid",
  "alert_fire_uuid": "$alert_fire_uuid",
  "state": "$alert_state",
  "value": "$breaching_datapoint_value",
  "deep_link": "$deep_link" 
}
  1. Plain text format:
Alert $alert_name ($alert_uuid) is $alert_state with value $breaching_datapoint_value
  1. XML format:
<alert>
  <name>$alert_name</name>
  <uuid>$alert_uuid</uuid>
  <fire_uuid>$alert_fire_uuid</fire_uuid>
  <state>$alert_state</state>
  <value>$breaching_datapoint_value</value>
</alert>
Remember to set the Content-Type header in the headers section with the appropriate value.
After your webhook is added, you can select your webhook as a destination in the alert creation wizard. Alert Destination - Webhook
You can check webhook delivery status and errors in Metoro Logs view. This provides visibility into successful deliveries and any issues encountered. Go to the Logs page and filter by envrionment=metoro-internal and service.name=metoro-webhooks to see webhook notifications that are successfully sent or failed with errors.