40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
# SigNoz -> Telegram alerting setup
|
|
|
|
## Alerts config section example (`config.yaml`)
|
|
|
|
```yaml
|
|
alerts:
|
|
telegram_enabled: true
|
|
telegram_bot_token: "123456789:telegram-bot-token"
|
|
telegram_chat_id: "-1000000000000"
|
|
provider_5xx:
|
|
error_count: 5
|
|
window_minutes: 5
|
|
provider_p99_latency:
|
|
threshold_ms: 5000
|
|
window_minutes: 10
|
|
provider_unavailable:
|
|
duration_minutes: 5
|
|
```
|
|
|
|
## Routing artifacts
|
|
|
|
- `signoz_contact_point_telegram.yaml`:
|
|
- webhook endpoint points to Telegram Bot API `sendMessage`
|
|
- uses `G2S_ALERTS__TELEGRAM_BOT_TOKEN` and `G2S_ALERTS__TELEGRAM_CHAT_ID`
|
|
- `signoz_alert_rules.yaml`:
|
|
- provider 5xx: `>= 5 errors / 5m`
|
|
- provider p99 latency: `> 5000ms / 10m`
|
|
- provider unavailable: `> 5m`
|
|
|
|
## Local verification steps
|
|
|
|
1. Export Telegram variables (must match `config.yaml -> alerts` values):
|
|
- `export G2S_ALERTS__TELEGRAM_BOT_TOKEN="<bot_token>"`
|
|
- `export G2S_ALERTS__TELEGRAM_CHAT_ID="<chat_id>"`
|
|
2. Validate compose syntax:
|
|
- `docker compose config`
|
|
3. In SigNoz UI, create a webhook contact point using `infra/alerts/signoz_contact_point_telegram.yaml`.
|
|
4. Create three alert rules from `infra/alerts/signoz_alert_rules.yaml`.
|
|
5. Use SigNoz "Test alert" action and verify message delivery in Telegram chat.
|