StatusDrift integrates with Telegram to send monitoring alerts directly to your Telegram chats or groups. This guide explains how to configure the Telegram integration using a bot to receive real-time notifications.
What This Integration Does
The Telegram integration sends messages to your configured chat when:
- A monitored service goes down or becomes degraded
- A service recovers and returns to normal status
- SSL certificates are approaching expiration
- Performance thresholds are exceeded
Prerequisites
Before configuring the Telegram integration, ensure you have:
- A StatusDrift account with at least one monitor configured
- A Telegram account
- Access to create a Telegram bot (via BotFather)
Step 1: Create a Telegram Bot
First, create a bot using Telegram’s BotFather:
- Open Telegram and search for @BotFather
- Start a conversation and send the command
/newbot - Follow the prompts to set a name for your bot (e.g., “StatusDrift Alerts”)
- Choose a username for the bot (must end in “bot”, e.g., “statusdrift_alerts_bot”)
- BotFather will provide an API token. Copy and save it securely
Step 2: Get Your Chat ID
To send messages, you need your Telegram chat ID:
For personal chats:
- Search for your new bot in Telegram and start a conversation
- Send any message to the bot
- Visit
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdatesin your browser - Find the
chat.idvalue in the response
For group chats:
- Add your bot to the group
- Send a message in the group that mentions the bot
- Use the same getUpdates URL to find the group’s chat ID (will be a negative number)
Step 3: Add the Telegram Channel in StatusDrift
Now configure the integration in your StatusDrift dashboard:
- Log in to your StatusDrift account at app.statusdrift.com
- Select Notifications in the sidebar
- Click Add channel
- Under Choose Service, click the Telegram tile to open the Configure step
- Enter a descriptive name for this channel
- Enter the Bot Token from BotFather
- Enter the Chat ID where notifications should be sent
- Click Create Channel
Step 4: Assign to Monitors
Connect the notification channel to your monitors:
- Go to Monitors in the sidebar
- Select the monitor you want to receive Telegram notifications
- Open the monitor’s actions menu (⋯), choose Edit and go to the Alert Configuration tab
- In an alert rule, select your Telegram channel in the Channels field (click Add Alert first if the monitor has no alert rules)
- Save the monitor configuration
Testing the Integration
Verify your Telegram integration is working:
- Select Notifications in the sidebar
- Find your Telegram channel in the list
- Open the channel’s actions menu (⋯) and choose Send test, or open the channel and click Test
- Check your Telegram chat for the test message
Configuration Options
The Telegram integration supports these configuration options:
| Field | Required | Description |
|---|---|---|
| Bot Token | Yes | The API token provided by BotFather when creating your bot |
| Chat ID | Yes | The Telegram chat ID where notifications will be sent |
Troubleshooting
Messages not being received
- Verify the bot token is correct and the bot has not been deleted
- Confirm the chat ID is correct (personal chats are positive, groups are negative)
- Ensure you have started a conversation with the bot (required for personal chats)
- For groups, verify the bot has been added and has permission to post
Bot removed from group
- Re-add the bot to the group
- The chat ID may change. Verify and update it in StatusDrift if needed
Rate limiting
- Telegram has rate limits for bot messages
- If you have many monitors, consider grouping alerts or using fewer notification channels