---
title: "Instrumentation"
description: "Learn what Sentry instruments automatically, and how to configure spans to capture tracing data on any action in your app."
url: https://docs.sentry.io/platforms/python/tracing/instrumentation/
---

# Instrumentation | Sentry for Python

To capture transactions and spans customized to your organization's needs, you must first [set up tracing](https://docs.sentry.io/platforms/python/tracing.md).

There are two ways that instrumentation is applied to your application:

## [Automatic Instrumentation](https://docs.sentry.io/platforms/python/tracing/instrumentation.md#automatic-instrumentation)

Many integrations for popular frameworks automatically capture transactions that can be sent to Sentry. Read more about automatic instrumentation [here](https://docs.sentry.io/platforms/python/tracing/instrumentation/automatic-instrumentation.md).

## [Custom Instrumentation](https://docs.sentry.io/platforms/python/tracing/instrumentation.md#custom-instrumentation)

To add custom performance data to your application, you need to add custom instrumentation in the form of [spans](https://docs.sentry.io/concepts/key-terms/tracing/distributed-tracing.md#traces-transactions-and-spans). Spans are a way to measure the time it takes for a specific action to occur. For example, you can create a span to measure the time it takes for a function to execute. Learn more about span lifecycles [here](https://docs.sentry.io/platforms/python/tracing/span-lifecycle.md).

## Pages in this section

- [Automatic Instrumentation](https://docs.sentry.io/platforms/python/tracing/instrumentation/automatic-instrumentation.md)
- [Legacy OpenTelemetry Integration Support](https://docs.sentry.io/platforms/python/tracing/instrumentation/opentelemetry.md)
- [Custom Instrumentation](https://docs.sentry.io/platforms/python/tracing/instrumentation/custom-instrumentation.md)
