Skip to content

Notifier

Source: src/Axiom/Notifier.ts

An Axiom notifier — an alert destination (Slack, email, PagerDuty, Opsgenie, Discord, Microsoft Teams, generic webhook, or a fully custom webhook with templated body/headers) that {@link Monitor monitors} target via notifierIds. Exactly one channel under properties should be set.

Slack incoming webhook

const slack = yield* Axiom.Notifier("ops-slack", {
name: "ops-channel",
properties: {
slack: { slackUrl: process.env.SLACK_WEBHOOK_URL! },
},
});

Email distribution list

yield* Axiom.Notifier("ops-email", {
name: "ops-team",
properties: { email: { emails: ["sre@example.com", "oncall@example.com"] } },
});

PagerDuty integration

yield* Axiom.Notifier("pagerduty", {
name: "primary-oncall",
properties: {
pagerduty: { routingKey: process.env.PAGERDUTY_ROUTING_KEY!, token: "" },
},
});

Custom webhook with templated body

yield* Axiom.Notifier("incident-webhook", {
name: "incident.io",
properties: {
customWebhook: {
url: "https://api.incident.io/v2/alert_events",
headers: { "Content-Type": "application/json" },
secretHeaders: { Authorization: `Bearer ${process.env.INCIDENT_TOKEN}` },
body: '{"title": "{{.Monitor.Name}}", "status": "firing"}',
},
},
});