New RelicTelegram

Post New Relic open issues to Telegram

A New Relic + Telegram agent flow

New Relic groups correlated violations into issues, and the on-call who needs to see them is often not the person watching the New Relic UI at 2am. A small team that lives in a Telegram group wants the open issue list to land where they already talk. Your agent reads the account's currently-open issues with list_recent_issues, compares them to what it saw last run, and posts the new ones to a Telegram chat with send_message. New Relic answers the agent's call rather than pushing, so you set the cadence, every minute or every five, and only issues that weren't open before turn into a message.

The flow

New Reliclist_recent_issues

Lists all currently open issues in an account.

Telegramsend_message

Sends a text message to a chat.

Step by step

  1. Pick the account and the chat

    Decide which New Relic account the agent reads and which Telegram chat receives the posts. Resolve the chat once with get_chat or resolve_username so the agent has a stable target ID.

  2. Read open issues

    The agent calls list_recent_issues, which returns every issue currently open in the account, each with its title, priority, and the entities it touches.

  3. Diff against the last run

    Keep the issue IDs from the previous poll. Post only IDs that are newly present, so a long-running issue is announced once instead of every interval, and a closed issue stops appearing on its own.

  4. Send to Telegram

    For each new issue the agent calls send_message with the issue title, its priority, the affected service, and a link, so the group sees the same line whether they open New Relic or not.

Tell your agent

Every two minutes, list currently-open New Relic issues in our production account. For any issue ID that wasn't open on the last check, send a Telegram message to the on-call group with the issue title, priority, affected entity, and a link. Don't repeat an issue that's still open from before.

Setup

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

Worth knowing

  • list_recent_issues returns everything currently open, not a feed of changes, so the agent has to remember the prior ID set and post only the additions to avoid re-announcing the same issue each poll.
  • An issue can reopen after closing. If you want the reopen flagged, track the closed state too rather than only first-seen IDs, otherwise a flap goes silent.
  • Telegram needs a numeric chat ID, not a group name. Resolve it once with resolve_username or get_chat and store it, since posting to the wrong ID fails quietly.

Questions

Does the message arrive the moment an issue opens?
No. New Relic responds when the agent calls it, so the post trails the issue by your polling interval. A two-minute loop keeps it close without hammering the API.
Will a single noisy service flood the chat?
Only on its first open, since the diff suppresses repeats. If one entity opens many distinct issues at once you can have the agent group them into one message by affected service before sending.
Can it post priority and severity, not just a title?
Yes. list_recent_issues carries priority and the entities involved, so the agent can build a line with the title, priority, and service before calling send_message.