Easy integration with sentry for zappa apps
Project description
# zappa-sentry
Sentry handler configuration with defaults for zappa lambdas.
# Installation
`pip install zappa_sentry`
# Zappa configuration
Setup your sentry DSN as the value of environment variable `SENTRY_DSN`, either on the `zappa_setting.json` file or in any of the other methods on https://github.com/miserlou/zappa/#setting-environment-variables
Then you can setup the `zappa_sentry.unhandled_exceptions` handler.
Example:
```
{
"dev": {
...
"environment_variables": {
"SENTRY_DSN": "https://*key*:*pass*@sentry.io/*project*",
...
},
"exception_handler": "zappa_sentry.unhandled_exceptions",
...
},
...
}
```
And that's all. Deploy your zappa function and you should see any errors appearing on sentry.
If you want the exception handler to capture the exception and capture it, just replace `zappa_sentry.unhandled_exceptions` by `zappa_sentry.capture_exceptions`. This version won't let the exceptions propagate.
# Adding extra information
Just add it to the scope as normal for the new sentry-sdk: https://docs.sentry.io/enriching-error-data/context/?platform=python
Sentry handler configuration with defaults for zappa lambdas.
# Installation
`pip install zappa_sentry`
# Zappa configuration
Setup your sentry DSN as the value of environment variable `SENTRY_DSN`, either on the `zappa_setting.json` file or in any of the other methods on https://github.com/miserlou/zappa/#setting-environment-variables
Then you can setup the `zappa_sentry.unhandled_exceptions` handler.
Example:
```
{
"dev": {
...
"environment_variables": {
"SENTRY_DSN": "https://*key*:*pass*@sentry.io/*project*",
...
},
"exception_handler": "zappa_sentry.unhandled_exceptions",
...
},
...
}
```
And that's all. Deploy your zappa function and you should see any errors appearing on sentry.
If you want the exception handler to capture the exception and capture it, just replace `zappa_sentry.unhandled_exceptions` by `zappa_sentry.capture_exceptions`. This version won't let the exceptions propagate.
# Adding extra information
Just add it to the scope as normal for the new sentry-sdk: https://docs.sentry.io/enriching-error-data/context/?platform=python
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
zappa_sentry-0.4.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for zappa_sentry-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 911adb6eb8d6e19a5f33c6f6e2a2d553446356aa0058f2bfa25083f43893762f |
|
MD5 | 64dcf4bea50968f66eb13579bdd3d0fa |
|
BLAKE2b-256 | 36a02b53e4814d150b2e65d1b0975b464d4ef3ac4fadb6f02c2b9e81c5788575 |