sentry-mattermost-plugin
A Sentry plugin that sends issue notifications to a self-hosted Mattermost instance via the Mattermost Bot API.
Official Repo seems to be outdated. So here's alternative.
Inspired by sentry-telegram.
Requirements
- Sentry (self-hosted)
- Python 3.8+
- A Mattermost Bot account with a token
Installation
Install the package into Sentry's Python environment:
pip install sentry-mattermost-plugin
Or in development mode from source:
git clone https://github.com/masstek/sentry-mattermost-plugin
cd sentry-mattermost
pip install -e .
Restart Sentry after installation so the entry point is picked up.
Configuration
- In Sentry, go to Project Settings → Legacy Integrations.
- Find Mattermost Notifications and click Configure plugin.
- Fill in the fields:
| Field | Description |
|---|---|
| Mattermost Host | Base URL of your Mattermost instance, e.g. https://mattermost.company.com |
| Bot Token | Access token for the Mattermost Bot account |
| Channel IDs | One channel ID per line. Find IDs via Mattermost → channel name → View Info |
| Message Template | Optional. Supports {project_name}, {url}, {title}, {message}, {tag[key]} |
| Verify SSL Certificate | Uncheck if your instance uses a self-signed certificate |
- Click Save changes.
- Click Test Plugin to send a test notification to all configured channels.
Creating a Mattermost Bot
- In Mattermost go to Main Menu → Integrations → Bot Accounts.
- Click Add Bot Account, give it a name, and save.
- Copy the generated token — this is the Bot Token for the plugin.
- Add the bot to the channels it needs to post in.
Message Template
The default template is:
*[Sentry]* {project_name} | {title}
{url}
{message}
Available variables:
| Variable | Description |
|---|---|
{project_name} |
Sentry project name |
{url} |
Link to the Sentry issue |
{title} |
Error title (truncated to 500 characters) |
{message} |
Error message |
{tag[key]} |
Value of a Sentry tag by key, e.g. {tag[environment]}. Returns [NA] if absent. |
Mattermost Markdown is supported in the template.
Running Tests
pip install pytest pytest-cov requests django
pytest tests/ --cov=sentry_mattermost_plugin --cov-report=term-missing
No Sentry installation is required to run the tests.
License
MIT
Metadata
Release files for sentry-mattermost-plugin 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sentry_mattermost_plugin-0.1.1.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sentry_mattermost_plugin-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / sentry_mattermost_plugin-0.1.1.tar.gz
| Download URL | sentry_mattermost_plugin-0.1.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
769d62a2273157c890bdca7e6f2b7c40c9e13959b27210cd5410b6933ccc5781
|
|
BLAKE2b-256 checksum How to use checksums |
9a1d6a3f811e30e475e2324c3d66e2f47024036e423f2ce8d99612803c4a4fb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / sentry_mattermost_plugin-0.1.1-py3-none-any.whl
| Download URL | sentry_mattermost_plugin-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0d4a74be7efdbf4a12b287209aeb90b9f0544af9828c00c149b3d24e4fbfb27
|
|
BLAKE2b-256 checksum How to use checksums |
91e1159d9f241ce4dae396f61b87c503c3b7e5b2b938ada4450d00eb615fcee1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|