feat(telegram): route Envio indexer problems to a dedicated channel - #335
Merged
Conversation
Indexer staleness, an unreachable GraphQL endpoint and GraphQL errors are all the same operational problem for whoever runs the indexer, so they now land in one chat (TELEGRAM_CHAT_ID_ENVIO) instead of being spread across the general errors feed. send_envio_error_message falls back to send_error_message when the chat id is unset, so visibility is never lost. Only Envio failures are rerouted; every other operational error still goes to the errors channel. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Envio indexer failures are actioned by whoever runs the indexer, not by protocol owners, so they now go to their own Telegram group instead of being mixed into the general errors feed.
Setup
One new env var — a standalone chat served by the DEFAULT bot, no topic thread and no dedicated bot token:
If it's unset, these alerts fall back to the errors channel, and from there to the protocol's own chat — visibility is never lost.
Changes
utils/telegram.pyENVIO_CHANNELandsend_envio_error_message(message, protocol, ...): plain-text, silent,[protocol]-labelled.[label]send into_send_labelledand generalized_error_channel_configured→_channel_configured(channel).send_error_messagebehavior is unchanged.Rerouted — only Envio failures; every other operational error still goes to the errors channel:
protocols/yearn/check_indexer_freshness.py— stale/missing chains, indexer unavailable, recovery.protocols/yearn/alert_large_flows.py— Envio GraphQL HTTP error.protocols/timelock/timelock_alerts.py— Envio unreachable after retries, GraphQL errors.Docs (
.env.example,monitoring.yaml,protocols/yearn/README.md) and tests updated: three new routing tests intests/test_utils.py, freshness fixture patches the new function.Not included
protocols/3jane/main.pyhits the same indexer but only logs warnings on Envio failures — it sends no Telegram alert at all, so there was nothing to reroute. Adding alerts there is a separate call.Testing
ruff check/formatclean; full suite passes (715 passed, 4 skipped).🤖 Generated with Claude Code