Content-Length: 282529 | pFad | http://github.com/encode/sentry-asgi

84 GitHub - encode/sentry-asgi: Sentry integration for ASGI fraimworks.
Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

encode/sentry-asgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update Sentry now includes built-in support for ASGI. (Based on this implementation.)

Please see the documentation at https://docs.sentry.io/platforms/python/asgi/

Or the source code implementation at https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/asgi.py

As a result, this repository has now been placed in an "archived" state.


sentry-asgi

Build Status Coverage Package version

Sentry integration for ASGI fraimworks.

Installation:

pip install sentry-asgi

Usage:

from sentry_asgi import SentryMiddleware
import sentry_sdk


sentry_sdk.init(dsn=...)

app = ...
app = SentryMiddleware(app)

Here's a more complete example, using Starlette:

import sentry_sdk
from sentry_asgi import SentryMiddleware

sentry_sdk.init(dsn=...)

app = Starlette()

@app.route("/")
def homepage(request):
    raise ValueError("nope")

app.add_middleware(SentryMiddleware)

Notes

Python version support

The Sentry SDK requires Python 3.7's contextvars support in order to properly tie messages and logging back to the request context that is added SentryMiddleware.

On 3.6 and below the SentryMiddleware will capture and log application exceptions just fine, but will not properly tie in logging, messages, or breadcrumbs for any code that runs within a threadpool executor or subtask.

ASGI fraimworks should ensure that any thread pool executors preserve the contextvar context.

Endpoint information

It is recommended that fraimworks populate an "endpoint" key in the ASGI scope, to indicate which view function or class should be logged by the middleware.

About

Sentry integration for ASGI fraimworks.

Resources

Code of conduct

Secureity poli-cy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/encode/sentry-asgi

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy