Set Up Tracing

Learn how to enable tracing in your Python SDK and get valuable performance insights about your application.

With tracing, Sentry tracks your software performance, measuring metrics like throughput and latency, and displaying the impact of errors across multiple systems. Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services. Learn more about our model in Distributed Tracing.

If you’re adopting Tracing in a high-throughput environment, we recommend testing prior to deployment to ensure that your service’s performance characteristics maintain expectations.

Activate tracing by setting enable_tracing to True.

Note that enable_tracing is available in Sentry Python SDK version ≥ 1.16.0. To enable tracing in older SDK versions (≥ 0.11.2), use traces_sample_rate=1.0.

import sentry_sdk


Learn more about tracing options, how to use the traces_sampler function, or how to sample transactions.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").