SentryTelegram

Post Sentry issues to Telegram

A Sentry + Telegram agent flow

A new crash spikes at 2am and the only people awake are the ones already paged. The rest of the team finds out at standup, hours after the first user hit it. This recipe gives a small team a cheaper signal: your agent reads Sentry's open issues and drops the ones that matter into a Telegram chat everyone already has on their phone. It calls search_issues with a query you choose, say unresolved errors in your production project above some event count, then writes the title, culprit, and a link with send_message. No webhook is involved. The Sentry server answers when the agent asks, so you run it on a cadence, every few minutes during a deploy or hourly otherwise, and the chat fills only with what cleared your bar.

The flow

Sentrysearch_issues

Searches for grouped issues/problems in Sentry, returning a list of issues.

Telegramsend_message

Sends a text message to a chat.

Step by step

  1. Define what's worth waking up for

    Tell the agent the Sentry org, project, and a search filter: unresolved issues, a level like error or fatal, maybe a minimum events count so a single stray exception stays quiet.

  2. Read the open issues

    The agent calls search_issues with that query and gets back the grouped problems, each with a title, the culprit code path, event volume, and a permalink.

  3. Post the ones that cleared the bar

    For each issue past your threshold, it calls send_message to the chat ID you set, with a short line: the error, the project, the count, and the Sentry link to open it.

  4. Skip what it already sent

    Have the agent remember the issue IDs it posted last run so a long-lived error isn't re-announced every cycle, only when its status or count changes.

Tell your agent

Every ten minutes, search Sentry for unresolved error-level issues in the prod project with more than 50 events in the last hour. For each new one, send a Telegram message to chat -1001234567890 with the title, event count, and the Sentry link. Don't repost issues you already announced.

Setup

This flow needs both servers connected to your agent. Follow each install guide:

Worth knowing

  • send_message takes a Telegram chat ID, not a channel name. Resolve your group or channel to its numeric ID once and put it in the prompt; the telegram-mcp server drives a real user account, so it can only post to chats that account is in.
  • search_issues returns grouped issues, not individual events. The count is how many times the group fired, so threshold on that, not on a single occurrence.
  • Sentry's search supports its own query syntax (is:unresolved, level:error, project:). Spell the filter out for the agent so it doesn't guess and pull in resolved noise.

Questions

Why not just use Sentry's own alert rules?
You can, and for high-volume teams those are fine. This is for the case where you want one agent reading Sentry and routing to a chat you control, with your own filtering logic, without configuring a separate integration per project.
Does it fire the instant an error happens?
No. The Sentry server responds to calls, it doesn't push. The agent reads on whatever schedule you set, so the chat lags real time by your interval. Tighten the cadence during a release if you need it closer to live.
Can it post to a regular Telegram channel?
Yes, as long as the account behind the server is a member or admin of that channel. Pass the channel's ID the same way you would a group chat.