Skip to main content

A production-ready sentry configuration module for Python.

Project description

logo

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)

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

gadfastsentry-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gadfastsentry-0.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file gadfastsentry-0.0.1.tar.gz.

File metadata

  • Download URL: gadfastsentry-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastsentry-0.0.1.tar.gz
Algorithm Hash digest
SHA256 deac22ae6f0ba0342f2c8496a67eef8a9cdb6a54cb093967f5ac44c5ce9a92e4
MD5 0a44d85a019fc7a50428246abbfea59f
BLAKE2b-256 2a19937c0b2df8c6a4bc8ccd6448f60f03bf9a03a420dde0341174a800756b4b

See more details on using hashes here.

File details

Details for the file gadfastsentry-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gadfastsentry-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastsentry-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b4ba40eb5262bed869b06817f244dd98232d548a7e367167bf4ac6e5441d2bc
MD5 fbcf1cad2e13ddc76170aa974fb961ff
BLAKE2b-256 d1538c66f191d8f50e7ffced697007031f892c06643cc47b46428d28bc151f6b

See more details on using hashes here.

Supported by

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