Handle uncaught exceptions and log them to GitLab as issues.
Project description
Python gitlab reporter
A custom exception handler that can be used to (re)open issues on Gitlab for projects written in Python.
The aim was to build a very small module that is easy to use and that works with a local Gitlab instance. This module is useful for those who want to aggregate runtime errors in a central location without using third-party software (e.g. sentry.io, etc).
Duplicate errors will be tracked in a single issue and will not be duplicated to avoid error-spamming.
The script is thread-safe and handles errors from Thread.run()
.
Installation
The module is available on Pypi:
pip install python-gitlab-reporter
In your Python project call:
from reporter.core import Reporter
Reporter.init("https://gitlab.com", private_token="12345657678890", project_id=123456)
How does it work?
The script adds custom hooks to sys.excepthook and
threading.excepthook.
These wrap around the original hooks and send issues to Gitlab. Any error that is caused by python-gitlab-reporter
itself is ignored. The original sys.excepthook
and threading.excepthook
will always be called, so that
the exceptions still terminate the program, etc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-gitlab-reporter-0.0.1.tar.gz
.
File metadata
- Download URL: python-gitlab-reporter-0.0.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02fb01a6c050bdde53d902c7ed7f8086d9153818574a26aed07c36679e0ca89b |
|
MD5 | 26e90973808463b52a9e315a5f036e32 |
|
BLAKE2b-256 | 90c6f143222dec8ff4578b15a05dd77a302634ce1932f5b61b918a2bc9a668d4 |
File details
Details for the file python_gitlab_reporter-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: python_gitlab_reporter-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9cce502a81dd770279b67ac8a644797ecefa873b98a12689d145599de5467ea |
|
MD5 | 6aac1dd3ff199428d8c5c99e97b40898 |
|
BLAKE2b-256 | 2d505bbfbe08531e2bf671f7374a173ff4a08e72d4002d401e36e81042fd7282 |