Skip to main content

Handle uncaught exceptions and log them to GitLab as issues.

Project description

Python gitlab reporter

PyPI license downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-gitlab-reporter-0.0.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

python_gitlab_reporter-0.0.1-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page