Integrations

Telegram Integration

Push real-time log alerts directly into your Telegram chat. Configure a custom bot, define message templates, and trigger actions straight from the notification.

Setup Steps

Get your LogTrace bot running in under five minutes. Follow these three steps to connect your project to a Telegram group or channel.

1. Register a Bot with BotFather

Open Telegram and start a conversation with @BotFather. Send the command /newbot, then follow the prompts to choose a display name (e.g., "LogTrace Alerts") and a username ending in bot (e.g., logtrace_prod_bot). BotFather will return an HTTP API token such as 714829305:AAHxK3mQvR7pL2nF9sTcUwYjE6bD4oI1gMk. Keep this token — you will paste it into LogTrace later.

2. Add the Bot to Your Chat

Navigate to the Telegram group or channel where you want to receive alerts. Open the chat settings, go to Administrators, and add your newly created bot as an admin. Grant it the "Send Messages" permission. If you are setting up a private channel, simply add the bot as a member — admin rights are not required.

3. Link the Chat in LogTrace

In your LogTrace dashboard, open Settings → Integrations → Telegram. Paste the API token from Step 1, then send the message /start to your bot from the chat you configured in Step 2. LogTrace will auto-detect the chat ID (e.g., -1001847263950) and display it in the integration panel. Click Save to activate the webhook.

Bot Configuration

Customize how LogTrace formats and delivers each alert. Control severity colors, inline action buttons, and the JSON payload structure.

Message Format Templates

LogTrace uses Handlebars-style templates for every notification. The default template for a CRITICAL alert looks like this:

[CRITICAL] {{project_name}} — {{alert_name}}\nTimestamp: {{timestamp_iso8601}}\nHost: {{host}}\nMessage: {{log_message}}\nDetails: {{url}}

You can edit the template in the integration settings. Available variables include {{project_name}}, {{alert_name}}, {{severity}}, {{timestamp_iso8601}}, {{host}}, {{log_message}}, {{source_file}}, {{line_number}}, and {{url}}.

Inline Action Buttons

Each Telegram notification can carry up to four inline buttons that trigger server-side actions without leaving the chat. Common button configurations for the "payment-gateway" project:

🔍 View in LogTrace — opens the relevant log entry in your browser via a deep link.\n🔄 Retry Deployment — calls the POST /api/v1/deployments/{{id}}/retry endpoint on your CI server.\n🔇 Mute 1h — suppresses this specific alert rule for sixty minutes.\n📋 Copy Context — copies the full JSON payload to your clipboard for pasting into incident tickets.

Button callbacks are defined in Settings → Integrations → Telegram → Action Buttons. Each button maps to a LogTrace webhook or an external HTTP endpoint.

Severity Routing & Quiet Hours

Route different severity levels to different chats. For example, send CRITICAL and ERROR alerts to your on-call group @logtrace-oncall, while WARNING and INFO go to the development channel @logtrace-dev-updates. Configure quiet hours (e.g., 02:00–06:00 MSK) to batch non-critical alerts into a single morning digest instead of flooding the chat.