Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rawandahmad698/pydiscordsentry
🚀 Send your sentry events to discord (with a Flask server)
https://github.com/rawandahmad698/pydiscordsentry
flask heroku sentry-sdk
Last synced: 13 days ago
JSON representation
🚀 Send your sentry events to discord (with a Flask server)
- Host: GitHub
- URL: https://github.com/rawandahmad698/pydiscordsentry
- Owner: rawandahmad698
- Created: 2022-06-14T13:55:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-05T20:25:58.000Z (over 2 years ago)
- Last Synced: 2024-12-20T03:06:27.504Z (16 days ago)
- Topics: flask, heroku, sentry-sdk
- Language: Python
- Homepage: https://rawa.dev
- Size: 14.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![py-Discord.png](https://i.postimg.cc/xTNx6mbZ/py-Discord.png)](https://postimg.cc/TpGJwp0j)
[PyDiscordSentry][]
===================
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg?style=flat-square)](https://www.python.org/downloads/)[md-pypi]: https://pypi.org/project/Markdown/
[pyversion-button]: https://img.shields.io/pypi/pyversions/Markdown.svgA 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.
[PyDiscordSentry]: https://sentry.io/
[Sentry's]: https://sentry.io/[Markdown]: https://daringfireball.net/projects/markdown/
[Features]: https://Python-Markdown.github.io#Features
[Available Extensions]: https://Python-Markdown.github.io/extensionsHow to use?
-------------```python
# Just like how you would use Sentry
sentry_sdk.init("https://@/",
release="1.0.0", debug=True)
```
```python
import sentry_sdksentry_sdk.init("https://[email protected]/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.