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

sentry-wrapper Changelog

2.4.0 (2019-07-05)

  • Replace raven (deprecated) by sentry-sdk

2.3.0 (2018-11-16)

I messed up release 2.2.0 and pushed a package on pypi with the wrong version. 2.3.0 is the correct version to use.

2.2.0 (never released)

  • Add a script which send message to sentry:

    sentry-msg --dsn https://... "my message to send"

2.1.1 (unreleased)

  • Under very active development.

2.1.0 (2018-05-23)

  • Add flag -t or –timeout. After the specified amount of time, sentry-wrapper exits and raises an error to Sentry. This is implemented by raising SIGALARM. If the wrapped application catches the signal, timeout won’t work.

2.0.0 (2015-08-20)

  • Accept extra arguments that are given to the wrapped command, like:

    sentry-wrapper entrypoint -- arg1 arg2 arg3

1.0.0 (2015-04-20)

  • Initial version.

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.4.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distributions

sentry_wrapper-2.4.0-py2.7.egg (6.9 kB view details)

Uploaded Source

sentry_wrapper-2.4.0-py2-none-any.whl (4.6 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: sentry-wrapper-2.4.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

File hashes

Hashes for sentry-wrapper-2.4.0.tar.gz
Algorithm Hash digest
SHA256 fe5605349fd98807aafa6ca4ca4d4c9335edcfa1880d1bc5ead2cf1cc4b0b4d9
MD5 bfe656a405f4459a6bbf1e7bddb4cfa8
BLAKE2b-256 2799e86a54d19edb4f0a8f0d38df202b1738a92a6a4bd4905ba2e904f98b4ce8

See more details on using hashes here.

File details

Details for the file sentry_wrapper-2.4.0-py2.7.egg.

File metadata

  • Download URL: sentry_wrapper-2.4.0-py2.7.egg
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

File hashes

Hashes for sentry_wrapper-2.4.0-py2.7.egg
Algorithm Hash digest
SHA256 92fa2a39b3235e03300f33677a084313983ef0333d226e7ad1bbc9edd2b1189d
MD5 5dfbe8ca686e16e9de87f44e03eeb189
BLAKE2b-256 c47723652f97a5714b5e64f953138d4386317ba1750b87d59a8215ea4870824c

See more details on using hashes here.

File details

Details for the file sentry_wrapper-2.4.0-py2-none-any.whl.

File metadata

  • Download URL: sentry_wrapper-2.4.0-py2-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

File hashes

Hashes for sentry_wrapper-2.4.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a15236667f0ecc86f22386805d2fc9d465418db8646d5de2379aefeb45c178ad
MD5 cf9135ff625e1f8b5a54d2f36bcad139
BLAKE2b-256 091f427ca0a00889610a4dfe439ca39dbd0b086a6b4d85bfac4e02d1aa63a01f

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