Skip to content

Conversation

bplatak
Copy link
Contributor

@bplatak bplatak commented Oct 2, 2025

We want to run multiple redundant instances of pyth-observer which poses an interesting problem around coordinations and alert deduplication. With ZenDuty we get deduplication for free - we just send it a hash and it does the rest for us - but Telegram does 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.

@bplatak bplatak requested a review from Copilot October 2, 2025 21:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-telegram CLI 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.

@bplatak bplatak merged commit 4ba3310 into main Oct 2, 2025
3 checks passed
@bplatak bplatak deleted the feat/reliability/add-disable-telegram-flag-1 branch October 2, 2025 21:53
bplatak added a commit that referenced this pull request Oct 2, 2025
bplatak added a commit that referenced this pull request Oct 2, 2025
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.

2 participants