Plugin for Sentry which allows sending notifications via the Telegram messenger.
As any plugins installation is only available for self-hosted Sentry instances, this plugin is unavailable for cloud-hosted Sentry.
The plugin has been tested with the most recent version of Sentry available at the time - 24.5.1.
origin_url
parameter in the configuration, see #20).DISCLAIMER: Sentry API is under development and is not frozen. I'm trying to keep up with the latest changes, but I can't guarantee compatibility with every version of Sentry. If you have any issues, please create an issue on GitHub.
Table of compatibility:
Plugin version | Compatible Sentry versions | Tested in Sentry versions |
---|---|---|
0.6.0 | 24.5.1, 24.6.x | 24.5.1 |
0.5.0 | 24.4.x to 24.5.0 | 24.4.1, 24.4.2, 24.5.0 |
0.4.0 | 8.x to 9.x | 8.9, 9.1.1 |
0.3.0 | 8.x to 9.x | 8.21, 8.22, 9.0.0, 9.1.0 |
0.2.2 | 8.x to 9.x | 8.21, 8.22, 9.0.0 |
0.2.1 | 8.x to 9.x | 8.21, 8.22, 9.0.0 |
0.2.0 | 8.x | 8.9, 8.10, 8.11, 8.12, 8.13, 8.14, 8.15, 8.16, 8.17 |
0.1.2 | 8.x | 8.9.0, 8.12.0 |
0.1.1 | 8.x | 8.9.0 |
[!TIP] You can initiate the plugin installation both before and after setting up a Sentry instance.
sentry/enhance-image.example.sh
file to sentry/enhance-image.sh
:
cp sentry/enhance-image.example.sh sentry/enhance-image.sh
Open sentry/enhance-image.sh
file in your favorite text editor and add the following line to the end of the file:
pip install sentry-telegram
Or apply this command:
echo "pip install sentry-telegram" >> sentry/enhance-image.sh
So, the file will look like:
#!/bin/bash
# Enhance the base $SENTRY_IMAGE with additional dependencies, plugins - see https://github.com/getsentry/self-hosted#enhance-sentry-image
# For example:
# apt-get update
# apt-get install -y gcc libsasl2-dev python-dev libldap2-dev libssl-dev
# pip install python-ldap
pip install sentry-telegram
If you want to install a specific version of the plugin, you can specify it in the command (for example, version 0.6.0):
echo "pip install sentry-telegram==0.6.0" >> sentry/enhance-image.sh
./install.sh
script to build the Sentry image with the plugin installed:
./install.sh
docker compose up -d
docker compose restart web worker cron sentry-cleanup
<your-sentry-installation-url>/settings/sentry/
).<your-sentry-installation-url>/settings/sentry/integrations/
).<your-sentry-installation-url>/settings/sentry/projects/<project-name>/
).<your-sentry-installation-url>/settings/sentry/projects/<project-name>/plugins/
).https://t.me/c/123456789
.
The chat ID in this case is -123456789
.
According to the Telegram Bot API requirements, you need to specify the chat ID with the minus sign (-
) at the beginning.https://t.me/c/123456789/5
, the chat ID is 123456789
and the Topic ID is 5
.
The receiver in this case will be -123456789/5
.Set the "Message Template" as you want, or start with the default one. You can use the following placeholders in the message template:
{project_name}
- the name of the project where the issue occurred.{url}
- the URL to the issue in the Sentry web interface.{title}
- the title of the issue.{message}
- the error message of the issue.tag[<tag_name>]
- the value of the tag with the name <tag_name>
. For example, tag[level]
. If the tag is not found, the placeholder will be replaced with [NA]
.Note that the Telegram message will be sent in Markdown format, so you can use Markdown formatting in the message template.
Test Results "No errors returned"
message at the top of the plugin configuration page, you are all set up! [!TIP] Don't forget to check the Sentry's alert rules to make sure that the Sentry will send notifications for the events you want (new issues only, or all issues, etc.).
If you find this project useful and would like to contribute financially, you can find several ways to do so on my GitHub Sponsors page. Your support will assist in covering the costs of the servers used for testing the plugin and will serve as motivation for further improvements.
Your support is highly appreciated!