Skip to content

Telegram

Telegram alerts require a bot token + chat ID. Once set up, alerts arrive on your phone with sub-second latency.

  1. Open Telegram, search for @BotFather
  2. Send /newbot
  3. Pick a name (display name) and username (must end in bot, e.g. my_dockmesh_bot)
  4. BotFather replies with the token — looks like 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz

Keep the token secret — anyone with it can post as your bot.

For a personal chat:

  1. Send any message to your bot from your personal Telegram account
  2. Open https://api.telegram.org/bot<YOUR-TOKEN>/getUpdates in a browser
  3. Find "chat":{"id":<YOUR-CHAT-ID>,...} in the JSON
  4. That’s your chat ID (usually a positive number for personal chats)

For a group:

  1. Create a Telegram group, add your bot to it
  2. Send any message in the group
  3. Same getUpdates URL — the chat ID is a negative number for groups (e.g. -123456789)

For a channel:

  1. Create a public or private channel, add your bot as admin with “Post messages” permission
  2. Use @channelname (for public) or the numeric chat ID (for private)

Telegram is not a built-in channel type — dockmesh ships email, Slack, Discord, Teams, ntfy, Gotify, PagerDuty, Pushover, plus a generic webhook. The supported pattern is to use the Generic webhook channel pointed at the Telegram Bot API:

Alerts → Channels → New channel → Generic webhook

FieldValue
Namepersonal-alerts
URLhttps://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=<CHAT_ID>&text={{message}}

{{message}} is the dockmesh-rendered alert text the webhook channel posts as the request body or query parameter, depending on how you configure it. For richer formatting (parse modes, silent notifications, HTML), put a tiny relay in front of dockmesh — a Cloudflare Worker, an n8n flow, or your own Telegram bot — that translates dockmesh’s webhook payload into a full sendMessage call.

Click Send test to confirm the Bot accepts the request.

The generic webhook channel POSTs the alert as JSON. Build your Telegram-side relay to read the metric, value, threshold, rule name, and container, then format the actual Telegram message however you want — bold, plain, inline keyboard buttons, whatever the Bot API supports.

Create one dockmesh channel per Telegram destination:

  • Personal DM: severity = critical only (for on-call)
  • Team group: all severities
  • Public channel: curated (only specific rules)

Attach different channels to different rules.

For non-urgent alerts, enable Silent notifications — Telegram delivers the message without sound/vibration. Useful for info-level alerts you want to log but not be paged for.

chat not found:

  • Chat ID is wrong. Re-check via getUpdates
  • For groups, make sure you added the bot before getting the chat ID (messages before bot was added don’t count)

bot was blocked by the user:

  • You blocked the bot in Telegram. Unblock it
  • Happens sometimes when testing — the “Stop” button in bot chat blocks it

No getUpdates output:

  • Make sure you sent at least one message to the bot first
  • Messages older than 24 hours don’t appear in getUpdates — send a fresh one