Skip to main content

No project description provided

Project description

Starlette-bugsnag

Bugsnag integration for Starlette ASGI framework.

Installation:

pip install starlette-bugsnag

Usage:

from starlette_bugsnag import BugsnagMiddleware
import bugsnag

bugsnag.configure(...)

app = ...
app = BugsnagMiddleware(app)

Here's a more complete example using Starlette and uvicorn:

import bugsnag
import os
import uvicorn

from starlette_bugsnag import BugsnagMiddleware
from starlette.applications import Starlette
from starlette.responses import PlainTextResponse

bugsnag.configure(api_key=os.getenv('BUGSNAG_API_KEY'), project_root=os.getcwd())

app = Starlette()
app.add_middleware(BugsnagMiddleware, debug=False)


@app.route("/")
def index(request):
    return PlainTextResponse("Hello World")


@app.route("/error")
def raiser(request):
    raise ValueError("This Is an Error")


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)

See examples for more.

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

starlette-bugsnag-0.2.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

starlette_bugsnag-0.2.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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