FastAPI Error and Performance Monitoring

Actionable insights to solve FastAPI errors.

Getting Started is Simple

Grab the Sentry Python SDK:

Copied!Click to Copy
pip install --upgrade sentry-sdk

Configure your DSN:

Copied!Click to Copy
from fastapi import FastAPI

import sentry_sdk
sentry_sdk.init(
    dsn="https://<key>@sentry.io/<project>",

    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for Tracing.
    # We recommend adjusting this value in production,
    traces_sample_rate=1.0,

    # If you wish to associate users to errors (assuming you are using
    # django.contrib.auth) you may enable sending PII data.
    send_default_pii=True,
)

app = FastAPI()

More than 150K Organizations Trust Sentry with Their Application Monitoring

FastAPI Error Monitoring with Complete Stack Traces

See FastAPI stack trace details like the class and method names so you never have to guess. Filter and group FastAPI exceptions intuitively to eliminate noise. Monitor errors at scale without impacting throughput in production.

FastAPI Performance Monitoring

Quickly identify FastAPI performance issues before they become downtime with performance monitoring. View the entire end-to-end distributed trace to see the exact, poor-performing API call and surface any related errors.

Fill In The Blanks About FastAPI Errors

Expose the important events that led to each FastAPI exception: app lifecycle, user actions, debug logs, network requests, past errors.

See the Full Picture of Any FastAPI Exception

With Sentry's exceptional exception handling in FastAPI, you can triage quickly based on specific parameters like platform, device type, or page name, for each issue. Set custom tags to recreate the error environment relevant to your app, business concerns, and users.

"Sentry's high-quality tooling helps Disney+ maintain high-quality service to its tens of millions of global subscribers."

Andrew Hay
Director of Engineering
Disney Streaming Services

Is your data secure? You better believe it.

Just look at all the high-quality security features all accounts get, regardless of plan.

  • Two-Factor Auth
  • Single Sign-On support
  • Organization audit log
  • SOC 2 Type II and ISO 27001 certified
  • HIPAA attestation
Learn more about security
  • PII data scrubbing
  • SSL encryption
  • Data Processing Addendum (includes latest EU SCCs)
  • Privacy Shield certified
Learn more about privacy

FAQs

Traditional logging provides you with a trail of events. Some of those events are errors, but many times they're simply informational. Sentry is fundamentally different because we focus on exceptions, or in other words, we capture application crashes. We discuss in more detail here and on our blog.

You can set up Suspect Commits to identify which commit likely caused an issue. You can also set up Code Mappings to link stack frames to your source code. See our documentation for more details.

You can get started for free. Pricing depends on the number of monthly events, transactions, and attachments that you send Sentry. For more details, visit our pricing page.

Resolve FastAPI errors with max efficiency, not max effort