Skip to main content

Forward exceptions raised by a setuptools entrypoint to sentry

Project description

DESCRIPTION

sentry-wrapper calls a setuptools entrypoint and sends exceptions to sentry. It is useful to log the exceptions of a correctly packaged but not sentry-capable program.

Usage:

usage: sentry-wrapper [options] [-- entrypoint options]

positional arguments:
  name                  Entry point name (eg. my-entrypoint)
  dist                  Distribution name (eg. my-project==1.2.4, default:
                        same value than name)
  group                 Entry point group (default: console_scripts)

optional arguments:
  -h, --help            show this help message and exit
  --dsn SENTRY_DSN      Sentry DSN
  -t timeout, --timeout timeout
                        Timeout. After this value, TimeoutError is raised to
                        Sentry.

For example, if the setup.py file of the package mypackage contains:

...
name='my-package',
entry_points={
    'console_scripts': [
        'my-entrypoint = mypackage:main',
    ],
},
...

Call my-entrypoint with:

sentry-wrapper --dsn SENTRY_DSN my-entrypoint my-package console_scripts

INSTALLATION

To install in a virtualenv:

$> virtualenv myenv
$> source myenv/bin/activate
$> pip install sentry-wrapper
$> pip install path/to/your/project
$> sentry-wrapper -h

DEVELOP

To start hacking on sentry-wrapper using Docker:

$> make

Then:

  • Visit http://localhost:9000 with the credentials test/test

  • Create a project and copy the DSN

  • Test sentry-wrapper against the test project of this repository:

    sentry-wrapper --dsn [...] whatever_ok whatever console_scripts
    sentry-wrapper --dsn [...] whatever_exception whatever console_scripts

CONTRIBUTORS

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

sentry-wrapper-2.5.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

sentry_wrapper-2.5.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file sentry-wrapper-2.5.0.tar.gz.

File metadata

  • Download URL: sentry-wrapper-2.5.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.16-arch1-1

File hashes

Hashes for sentry-wrapper-2.5.0.tar.gz
Algorithm Hash digest
SHA256 3d866c929eab2a0f7972f1d7018acfee1eaa22c3a4fbe58227d0b2703e0c2990
MD5 9cd345c7548d43279246e7d9a649aae9
BLAKE2b-256 e181eebc4cb4424c54b681c81f73149ef4de179fccb1f926cfcdca4afde87062

See more details on using hashes here.

File details

Details for the file sentry_wrapper-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: sentry_wrapper-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.16-arch1-1

File hashes

Hashes for sentry_wrapper-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f440c53d94f6605c482dfd04288c26ca92c2429e0a7c558b141d39bb86d31c43
MD5 af5331c721079018a9efac08bc49b114
BLAKE2b-256 93e36b24f9e742df8742d1815f533d598d95086858d57e82878440fd10d8e9e3

See more details on using hashes here.

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