slack

Reference for the `slack` action.

slack · action · run nanook doc slack for the same content in your terminal.

Posts alert attachments to a Slack channel via incoming webhook.

Options

OptionTypeDefaultDescription
urlstringrequired 🔒target webhook URL
methodenumPOSTHTTP method (one of: GET, POST, PUT, PATCH, DELETE)
retriesstring0number of retries on failure
backoffstring1sretry backoff

Examples

Slack channel via incoming webhook

[channels.ops]
type = "slack"
[channels.ops.opts]
url = "${SLACK_WEBHOOK_URL}"

Custom payload via rule body

[channels.ops]
type = "slack"
[channels.ops.opts]
url = "${SLACK_WEBHOOK_URL}"

[[alerts]]
expr    = "disk.usage > 90%"
channel = "ops"
body    = '{"text":":warning: {{ trigger.labels.mount }} at {{ trigger.val }}%"}'