feat(reliability) Add flag to disable telegram notifications#92
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a flag to disable Telegram notifications in the pyth-observer to support running multiple redundant instances with reliable ZenDuty alerts while avoiding duplicate Telegram messages.
- Adds a
--disable-telegramCLI flag and environment variable option - Modifies the dispatch logic to skip Telegram events when the flag is enabled
- Updates metrics to track whether Telegram notifications are enabled
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyth_observer/cli.py | Adds the new --disable-telegram CLI option and passes it to Observer |
| pyth_observer/init.py | Updates Observer constructor to accept and pass the disable_telegram parameter |
| pyth_observer/dispatch.py | Adds logic to skip TelegramEvent processing when disabled |
| pyth_observer/metrics.py | Adds telegram_enabled field to observer info metrics |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
merolish
approved these changes
Oct 2, 2025
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.
We want to run multiple redundant instances of
pyth-observerwhich poses an interesting problem around coordinations and alert deduplication. WithZenDutywe get deduplication for free - we just send it a hash and it does the rest for us - butTelegramdoes not offer the same functionality.Longer term we might need to run istio coordination layer (or just use some db 🤷 ) but for now we can at least get reliable zenduty alerts even if tg isn't there yet.