Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatamiarash7/prometheus-telegram
Yet another telegram bot handler for prometheus
https://github.com/hatamiarash7/prometheus-telegram
alertmanager monitoring prometheus telegram telegram-bot telegram-bot-api
Last synced: 18 days ago
JSON representation
Yet another telegram bot handler for prometheus
- Host: GitHub
- URL: https://github.com/hatamiarash7/prometheus-telegram
- Owner: hatamiarash7
- License: mit
- Created: 2022-03-06T12:13:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T17:26:48.000Z (7 months ago)
- Last Synced: 2024-04-25T00:56:04.287Z (7 months ago)
- Topics: alertmanager, monitoring, prometheus, telegram, telegram-bot, telegram-bot-api
- Language: Python
- Homepage:
- Size: 250 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Prometheus-Telegram
[![Telegram Handler](https://github.com/hatamiarash7/Prometheus-Telegram/actions/workflows/Publish.yml/badge.svg)](https://github.com/hatamiarash7/Prometheus-Telegram/actions/workflows/Publish.yml) ![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/hatamiarash7/telegram-handler) ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/hatamiarash7/telegram-handler)
It's a simple API to handle alert requests and send them via Telegram.
![sample](.github/tg-sample.jpg)
## How-to use
1. Create a Telegram bot using [botfather](https://t.me/botfather)
2. Keep `BOT TOKEN` for later
3. Get your **Chat id** using [@BotChatId_bot](https://t.me/BotChatId_bot) ( Or other bots/ways )
4. Run image with required environment variables```bash
docker run -d -p 8127:8127 \
-e TG_HOST=https://api.telegram.org \
-e TG_BOT_TOKEN='291043804:AAGHDLwaXNN2U2oI0uxCR35KsivsxNUqT3o' \
-e TG_CHAT_ID='-200160323059' \
hatamiarash7/telegram-handler:v1.2.0
```5. Use [alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) to send alerts using webhook to `http://:8127/api/alert` URL
## Proxy
We have a `TG_HOST` env variables here to bypass any **filtering or blocking**. You can proxy your custom domain to `https://api.telegram.org` and use it here.
```text
https://telegram.domain.com -> https://api.telegram.org
```There are many ways to do that, just search for it 😃
---
## Support 💛
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/D1D1WGU9)
## Contributing 🤝
Don't be shy and reach out to us if you want to contribute 😉
1. Fork it !
2. Create your feature branch : `git checkout -b my-new-feature`
3. Commit your changes : `git commit -am 'Add some feature'`
4. Push to the branch : `git push origin my-new-feature`
5. Submit a pull request## Issues
Each project may have many problems. Contributing to the better development of this project by reporting them. 👍