Channels

Where alerts go: email, webhooks, Slack, Discord or Telegram.

Overview

A channel is where alerts go: email through one of your email services, a webhook, Slack, Discord or Telegram.

When to use it

  • Alerts to the team chat.
  • Email to whoever is on call.
  • Alerts into another system.

How it works

Outbox
Notifications are stored first and sent every 2 seconds, so none is lost if something restarts.
Retries
A failed delivery is tried again after 15 s, 30 s, 1, 2 and 4 minutes.

Each delivery is recorded on the channel; the last 100 are kept so you can see what was sent and whether it arrived. Webhooks can be signed with HMAC-SHA256.

Architecture

Channels architectureAlerts write to an outbox; the notifier delivers with retries.deliverAlertOutboxNotifierevery 2 s, retriesEmail, chat or webhook
Alerts write to an outbox; the notifier delivers with retries.
  • Alert to Outbox
  • Outbox to Notifier
  • Notifier to Email, chat or webhook: deliver

Flows

A delivery

  1. An alert fires and writes a notification.
  2. The notifier sends it.
  3. If it fails, it is retried for about five minutes.

Set it up

In the console

  1. For chat apps, store the webhook URL or bot token as a secret.
  2. Open Channels and choose New channel.
  3. Use Test.

With the CLI

enclave channel create ops --webhook https://hooks.example.com/enclave --wait

With OpenTofu

OpenTofu configuration
resource "enclave_channel" "ops" {
  name    = "ops"
  type    = "webhook"
  webhook = { url = "https://hooks.example.com/enclave" }
}

Settings reference

Every setting and output of the OpenTofu resource; the console and the CLI use the same names in their own words. Generated from platform 4d30582.

enclave_channel
NameTypeUseWhat it does
nametextrequiredName of the channel: 3–40 lowercase letters, digits or hyphens, starting with a letter. Changing it replaces the channel.
typetextrequiredemail, webhook, slack, discord or telegram. Changing it replaces the channel.
chat_idtextoptionaltelegram: the chat ID.
emaillist of objectsoptionalemail: the service, sender and recipients.
projecttextoptionalThe project to create it in. Defaults to the provider's project (ENCLAVE_PROJECT, else default). Changing it replaces the resource.
secrettextoptionalslack, discord: the secret holding the webhook URL; telegram: the secret holding the bot token.
webhooklist of objectsoptionalwebhook: where JSON is posted.
idtextoutputResource ID.

Limits and security

Good to know

  • The last 100 deliveries per channel are kept.

Security

  • Chat tokens and webhook URLs are kept as secrets.