Skip to content

Triggers

Arael Espinosa edited this page Apr 23, 2026 · 2 revisions

Triggers

Triggers define how and where Piro sends notifications when an alert fires or recovers. Each trigger represents one notification channel. You can attach triggers to individual alert configs, or mark them as Global to automatically apply to all checks.

All triggers support Mustache templates ({{variable}}) for customizing message content. Available variables:

Variable Description
{{alert_name}} Name of the check that fired
{{alert_for}} Name of the service being monitored
{{alert_status}} Current check status (e.g. Down, Degraded)
{{alert_severity}} Severity level (e.g. Critical, Warning)
{{alert_description}} Alert description / note (may be empty)
{{alert_timestamp}} ISO 8601 timestamp of when the alert fired
{{is_resolved}} true if this is a recovery notification
{{is_triggered}} true if this is a new alert (not recovery)

Webhook

Sends an HTTP POST request to a URL of your choice with a JSON payload.

Configuration:

  • URL — the endpoint to POST to
  • Secret — optional HMAC-SHA256 signing secret; the signature is sent in X-Piro-Signature
  • Headers — optional key/value headers (e.g. Authorization: Bearer <token>)
  • Custom Body — override the default JSON payload with a Mustache template

Default payload:

{
  "alert_name": "{{alert_name}}",
  "alert_for": "{{alert_for}}",
  "alert_status": "{{alert_status}}",
  "alert_severity": "{{alert_severity}}",
  "alert_timestamp": "{{alert_timestamp}}",
  "is_resolved": {{is_resolved}},
  "is_triggered": {{is_triggered}}
}

Email

Sends an email notification via the SMTP server configured in your environment variables.

Configuration:

  • To — recipient address(es), comma-separated
  • From — sender address (overrides SMTP_FROM env var if set)
  • Custom HTML Template — full HTML email body with Mustache variables. Leave empty for the built-in template.

Required environment variables: see Environment Variables → SMTP section.


Slack

Sends a message to a Slack channel via an Incoming Webhook URL.

Configuration:

  • Webhook URL — the Slack Incoming Webhook URL
  • Custom Payload — override the default Slack Block Kit JSON. Supports Mustache variables.

How to get a Webhook URL:

  1. Go to api.slack.com/apps → create or open your app
  2. Navigate to Incoming Webhooks → toggle on → Add New Webhook to Workspace
  3. Select a channel and copy the generated URL

Telegram

Sends a message to a Telegram chat via the Bot API.

Configuration:

  • Bot Token — obtained from @BotFather on Telegram
  • Chat ID — the target chat, group, or channel ID
  • Custom Message Template — plain text / Markdown v1 message. Supports Mustache variables. Leave empty for the built-in alert format.

How to get a Bot Token:

  1. Open Telegram and start a chat with @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the token (format: 123456:ABC-DEF1234...)

How to get your Chat ID:

  • For a personal chat: start a chat with @userinfobot — it replies with your numeric ID
  • For a group: add @userinfobot to the group; it replies with the group ID (negative number, e.g. -1001234567890)
  • For a channel: use the channel username prefixed with @ (e.g. @mychannel) or the numeric ID

Note: Make sure to add your bot to the target group/channel and grant it permission to post messages.


PagerDuty

Sends alerts to PagerDuty via the Events API v2.

Configuration:

  • Integration URL — the Events API v2 endpoint (usually https://events.pagerduty.com/v2/enqueue)
  • Routing Key — the 32-character integration key from your PagerDuty service

How to get a Routing Key:

  1. In PagerDuty, go to Services → select your service → Integrations
  2. Add an integration → select Events API v2
  3. Copy the Integration Key

Microsoft Teams

Future — Microsoft Teams support is planned but not yet implemented.

Will send an Adaptive Card to a Teams channel via an Incoming Webhook.

Planned configuration:

  • Webhook URL — the Teams Incoming Webhook URL

How to get a Webhook URL (for when this is available):

  1. In Teams, go to the channel → ... menu → Connectors
  2. Find Incoming WebhookConfigure
  3. Give it a name and copy the generated URL

Clone this wiki locally