Giter Site home page Giter Site logo

butorov / sentry-telegram Goto Github PK

View Code? Open in Web Editor NEW
229.0 7.0 58.0 1.47 MB

Plugin for Sentry which allows sending notification via Telegram messenger.

License: MIT License

Python 100.00%
sentry telegram telegram-api telegram-bot sentry-plugin error-monitoring crash-reporting crash-reports hacktoberfest

sentry-telegram's Introduction

Sentry Telegram Build Status Coverage Status pypi

Plugin for Sentry which allows sending notification via Telegram messenger.

Presented plugin tested with Sentry from 8.9 to 9.1.1.

DISCLAIMER: Sentry API is under development and is not frozen.

How will it look like

How will it look like

Installation

  1. Install this package
pip install sentry-telegram
  1. Restart your Sentry instance.
  2. Go to your Sentry web interface. Open Settings page of one of your projects.
  3. On Integrations (or Legacy Integrations) page, find Telegram Notifications plugin and enable it.
  4. Configure plugin on Configure plugin page.

    See Telegram's documentation to know how to create BotAPI Token.

  5. Done!

sentry-telegram's People

Contributors

amokrushin avatar butorov avatar holycheater avatar konstantin-leontev avatar metheoryt avatar pupaxxo avatar stranger6667 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-telegram's Issues

Show triggered alert name in notification text

Hi!

we have several alert rules that trigger telegram notifications.
Is it possible to somehow inject triggered rule name in notification text?
Otherwise it's not clear is it first-time error or threshold error.
Thanks!

Implement testing of settings

It would be nice if plugin had some "test settings" action that would try to send test notification (to check, that bot token and receiver ids are correct).

Settings for different environments

It would be very useful to be able to make different settings for different environments. For example, disable notifications for a locale or send them to another chat.
image

More detailed documentation please

I'm interested in getting notifications for every Sentry error in my project. This appears to be my only hope to notify Sentry errors in Telegram.

However I'd like more detailed documentation on how to set this up. I have no idea where to install this package (somewhere on Sentry or locally, and if locally how would it work).

telegram

On "Legacy Integration" and on " organization integrations" page your plugin is missing

Can't see plugin

Hi!

I installed the plugin with pip install sentry-telegram and I can't see it neither in integrations nor in legacy integrations.

Do I have to do anything else?

Best, Yatekii

Error on first try

I've got the following error
Test Results: "There was an internal error with the Plugin"
after first test
( bot token and id is correct )

how can i find its log ?

Proxy support

There are countries that tries to block telegram.
I created PR #19 that add basic proxy support, but there are several issues with that.

Message to topic

Hello. Could you please add support for topics? Now it look like impossible to send message not just to general level

Doesnt work on 22.7.0.dev0

Versión: 0.4.0
Sentry Version: 22.7.0.dev0

I install & setup Legacy Integration with specific token & chatid but when i try to do a test it doesnt send message.

Can't see plugin in web interface

Add to requirements.txt

docker-compose up -d --build
Building sentry_web
Step 1/1 : FROM sentry:9.1-onbuild
# Executing 4 build triggers
 ---> Running in 538350efb466
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting sentry-telegram
  Downloading https://files.pythonhosted.org/packages/b1/28/8003f0cfb7c2f107b9eb66fbc1c98d86643005573fcdfd37a3b3037b4d95/sentry_telegram-0.4.0-py2-none-any.whl
Installing collected packages: sentry-telegram
Successfully installed sentry-telegram-0.4.0
docker-compose exec sentry_hard_worker pip install sentry-telegram
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: sentry-telegram in /usr/local/lib/python2.7/site-packages (0.4.0)
docker-compose exec sentry_web pip install sentry-telegram
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: sentry-telegram in /usr/local/lib/python2.7/site-packages (0.4.0)

But on interface can't see plugin
image

[onpremise] This plugin needs to install in which one of them?

When using onpremise, there are a lot if services,
This plugin needs to install in which one of them?

 sentry_onpremise_nginx_1
 sentry_onpremise_relay_1
 sentry_onpremise_ingest-consumer_1
 sentry_onpremise_subscription-consumer-events_1
 sentry_onpremise_post-process-forwarder_1
 sentry_onpremise_subscription-consumer-transactions_1
 sentry_onpremise_sentry-cleanup_1
 sentry_onpremise_cron_1
 sentry_onpremise_web_1
 sentry_onpremise_worker_1
 sentry_onpremise_snuba-cleanup_1
 sentry_onpremise_symbolicator-cleanup_1
 sentry_onpremise_snuba-consumer_1
 sentry_onpremise_snuba-transactions-consumer_1
 sentry_onpremise_snuba-api_1
 sentry_onpremise_snuba-replacer_1
 sentry_onpremise_snuba-outcomes-consumer_1
 sentry_onpremise_snuba-subscription-consumer-transactions_1
 sentry_onpremise_snuba-subscription-consumer-events_1
 sentry_onpremise_snuba-sessions-consumer_1
 sentry_onpremise_symbolicator_1
 sentry_onpremise_postgres_1
 sentry_onpremise_memcached_1
 sentry_onpremise_kafka_1
 sentry_onpremise_clickhouse_1
 sentry_onpremise_redis_1

Related issue

Does not work properly with Sentry onpremise 20.9.0

After migrating from version 8.22 to 20.9.0 sentry-telegram plugin no longer inserts {message} from issues into message body.
Messages sent by "Test Plugin" button are delivered correctly with {message}.
But messages from "real" alerts are delivered with empty {message} name.
As I understand it, this problem is related to changes in Sentry SDK.

def build_message(self, group, event):
the_tags = defaultdict(lambda: '[NA]')
the_tags.update({k:v for k, v in event.tags})
names = {
'title': event.title,
'tag': the_tags,
'message': event.message, <---- no longer work for issues in last versions.
'project_name': group.project.name,
'url': group.get_absolute_url(),
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.