A production-ready sentry configuration module for Python.
Installation
pip install gadfastsentry
Usage
import logging
import sentry_sdk
from fastapi import FastAPI
from fastapi import Request
from gadfastsentry import Sentry
Sentry(dsn="***", env="production")
app = FastAPI()
@app.middleware("http")
async def inject_trace(request: Request, call_next):
sentry_sdk.set_extra("trace_id", "12345")
return await call_next(request)
@app.get("/sentry-debug")
async def trigger_error():
try:
division_by_zero = 1 / 0
except Exception as e:
logging.error(str(e), exc_info=True)
Metadata
Release files for gadfastsentry 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gadfastsentry-0.0.1.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gadfastsentry-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / gadfastsentry-0.0.1.tar.gz
| Download URL | gadfastsentry-0.0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
deac22ae6f0ba0342f2c8496a67eef8a9cdb6a54cb093967f5ac44c5ce9a92e4
|
|
BLAKE2b-256 checksum How to use checksums |
2a19937c0b2df8c6a4bc8ccd6448f60f03bf9a03a420dde0341174a800756b4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / gadfastsentry-0.0.1-py3-none-any.whl
| Download URL | gadfastsentry-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b4ba40eb5262bed869b06817f244dd98232d548a7e367167bf4ac6e5441d2bc
|
|
BLAKE2b-256 checksum How to use checksums |
d1538c66f191d8f50e7ffced697007031f892c06643cc47b46428d28bc151f6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|