Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alerter: add Telegram alerter #137

Open
ManofWax opened this issue Feb 26, 2025 · 3 comments
Open

Alerter: add Telegram alerter #137

ManofWax opened this issue Feb 26, 2025 · 3 comments
Labels
good first issue Good for newcomers

Comments

@ManofWax
Copy link
Contributor

Create a new alerter integrating with Telegram API.

Steps:

@ManofWax ManofWax added the documentation Improvements or additions to documentation label Feb 26, 2025
@drona-gyawali
Copy link

drona-gyawali commented Feb 26, 2025

Hi @ManofWax, I propose implementing the Telegram Bot API (sendMessage method) for alerting .

Why Telegram Bot API?

  1. Simple bot-based integration: Easy to set up and manage via BotFather.
  2. Text formatting support: Supports Markdown/HTML for better readability.
  3. HTTP POST requests: Lightweight and easy to implement.

Implementation Steps

  1. Create a new TelegramAlerter class:

    • Inherit from BaseAlerter.
    • Use requests.post to send alerts via the sendMessage endpoint.
    • Add error handling for API failures.
  2. Update alerting.json:

    • Add Telegram-specific configuration:
  3. Write tests:

    • Mock requests.post to test success/failure scenarios.

@ManofWax ManofWax added good first issue Good for newcomers and removed documentation Improvements or additions to documentation labels Feb 26, 2025
@ManofWax
Copy link
Contributor Author

Ok seems good to me.

In addition to the steps on the issue, can you also add end user documentation on how to configure the bot and set up the alerte in a new file calle telegram.md here? https://github.com/certego/BuffaLogs/tree/main/docs/alerting

@drona-gyawali
Copy link

Understood! I will include the documentation in docs/alerting/telegram.md, detailing the bot configuration and alerter setup to ensure seamless integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants