Skip to content

feat(telegram): route Envio indexer problems to a dedicated channel - #335

Merged
spalen0 merged 1 commit into
mainfrom
feat/envio-alert-channel
Aug 6, 2026
Merged

feat(telegram): route Envio indexer problems to a dedicated channel#335
spalen0 merged 1 commit into
mainfrom
feat/envio-alert-channel

Conversation

@spalen0

@spalen0 spalen0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

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:

TELEGRAM_CHAT_ID_ENVIO=your-envio-chat-id

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.py

  • New ENVIO_CHANNEL and send_envio_error_message(message, protocol, ...): plain-text, silent, [protocol]-labelled.
  • Extracted the shared [label] send into _send_labelled and generalized _error_channel_configured_channel_configured(channel). send_error_message behavior 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 in tests/test_utils.py, freshness fixture patches the new function.

Not included

protocols/3jane/main.py hits 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/format clean; full suite passes (715 passed, 4 skipped).

🤖 Generated with Claude Code

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>
@spalen0
spalen0 marked this pull request as ready for review August 6, 2026 13:17
@spalen0
spalen0 merged commit baba604 into main Aug 6, 2026
3 checks passed
@spalen0
spalen0 deleted the feat/envio-alert-channel branch August 6, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant