Telegram
Synopsis
Sends alert notifications to Telegram chats using the Bot API, supporting HTML and Markdown formatting, severity-based emojis, silent notifications, and configurable message options.
Schema
- telegram:
bot_token: <string>
chat_id: <string>
message: <string>
parse_mode: <string>
disable_notification: <boolean>
disable_web_page_preview: <boolean>
severity: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
| Field | Required | Default | Description |
|---|---|---|---|
bot_token | N | ${TELEGRAM_BOT_TOKEN} | Telegram bot token |
chat_id | N | ${TELEGRAM_CHAT_ID} | Target chat ID (user, group, or channel) |
message | Y | - | Message text to send |
parse_mode | N | HTML | Text formatting mode: HTML, Markdown, or MarkdownV2 |
disable_notification | N | false | Send message silently without notification sound |
disable_web_page_preview | N | false | Disable link preview generation |
severity | N | - | Severity level for emoji prefix: info, warning, critical, or resolved |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | See Handling Failures |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
The telegram processor sends notifications to Telegram chats using the Bot API.
Bot Setup: Create a Telegram bot:
- Message @BotFather on Telegram
- Send
/newbotand follow the prompts - Copy the bot token provided
- Add the bot to your target chat/group/channel
Chat ID: The target for messages. Types include:
- Positive numbers: Private chats with users
- Negative numbers: Group chats (e.g.,
-1001234567890) - Channel usernames:
@channelname
Parse Modes: Control text formatting:
HTML: Use HTML tags (<b>,<i>,<code>,<a href="">, etc.)Markdown: Use Markdown syntax (*bold*,_italic_, backticks for code)MarkdownV2: Enhanced Markdown with more features
Severity Emojis: When severity is set, an emoji prefix is added:
resolved/success/good: ✔️critical/danger/error: ‼️warning/high: ⚠️info/low: ℹ️
Silent Notifications: Set disable_notification: true for non-urgent messages that shouldn't trigger notification sounds.
Template Support: All string fields support Go template syntax with event field interpolation using {{ .field_name }}.
For integration patterns with schema validation, see Schema Drift Detection.
Examples
Basic Alert
Sending a simple alert notification... | |
Message sent with ‼️ critical emoji prefix... |
HTML Formatting
Using HTML formatting for rich messages... | |
Bold title with italic and underlined labels... |
Markdown Formatting
Using Markdown for simpler formatting... | |
Markdown formatting with bold and italic text... |
Silent Notification
Sending non-urgent information silently... | |
Message delivered without notification sound... |
Complete Alert
Full-featured alert with all formatting options... | |
Rich formatted message with dashboard link preview... |
Schema Drift Alert
Alerting on schema validation failures... | |
Alert triggered automatically when schema drift detected... |
Dynamic Chat ID
Routing messages to different chats based on event data... | |
Message routed to team-specific chat... |