Skip to content

๐Ÿš€ Send your sentry events to discord (with a Flask server)

Notifications You must be signed in to change notification settings

rawandahmad698/PyDiscordSentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

py-Discord.png

Python 3.10

A very simple Flask+Python class to send Sentry's custom messages & exceptions to your Discord channel.

This repo contains the necessary to download and deploy to heroku.

How to use?

# Just like how you would use Sentry
sentry_sdk.init("https://<public_key>@<your_heroku_link>/<dsn>", 
                release="1.0.0", debug=True)
import sentry_sdk

sentry_sdk.init("https://Foo@awesomeapp.herokuapp.com/1", 
                release="1.0.0", debug=True)

That's it!

Bonus note: When you deploy to heroku, you may provide the discord webhook url as an env variable. Following is required env variables:

  • WEBHOOK_MAIN: The main webhook url to send the messages to.
  • WEBHOOK_ERRORS: Sometimes the class may not be able to cast the exception to a string, this is a fallback webhook to send the raw error to.
  • ICON_URL: Embed icon url.

Notes:

  1. The Classes/SentryParser.py will need to be updated to accept all types of events. Currently, It's very limited and I don't have much time to add more.
  2. I'm not a Flask expert, but I'm sure you'd point out certain things that I'm missing on app.py

Support

You may report bugs, ask for help, and discuss various other issues on the issues page.

About

๐Ÿš€ Send your sentry events to discord (with a Flask server)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published