Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/concepts/otlp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,13 @@ The following SDKs support the `propagateTraceparent` option:
label="React Native"
url="/platforms/react-native/configuration/options/#propagateTraceparent"
/>

## Dedicated Integrations

The following SDKs have dedicated integrations that make setting up OTLP a breeze.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this POTEL, or is there something else we've recently done to make Python specifically easier to set up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original POTEL project is dead
this is the first of the OTLP SDKs which is the project that replaces POTEL leveraging our new OTLP ingestion support


- <LinkWithPlatformIcon
platform="python"
label="Python"
url="/platforms/python/integrations/otlp"
/>
1 change: 1 addition & 0 deletions docs/platforms/python/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
| ----------------------------------------------------------------------------------------------------------------------------------- | :--------------: |
| <LinkWithPlatformIcon platform="python.asgi" label="ASGI" url="/platforms/python/integrations/asgi" /> | |
| <LinkWithPlatformIcon platform="python.asyncio" label="asyncio" url="/platforms/python/integrations/asyncio" /> | |
| <LinkWithPlatformIcon platform="python.opentelemetry" label="Opentelemetry (OTLP)" url="/platforms/python/integrations/otlp" /> | |
| <LinkWithPlatformIcon platform="python.pure_eval" label="Enhanced Locals" url="/platforms/python/integrations/pure_eval" /> | |
| <LinkWithPlatformIcon platform="python.gnu_backtrace" label="GNU Backtrace" url="/platforms/python/integrations/gnu_backtrace" /> | |
| <LinkWithPlatformIcon platform="python.rust_tracing" label="Rust Tracing" url="/platforms/python/integrations/rust_tracing" /> | |
Expand Down
66 changes: 66 additions & 0 deletions docs/platforms/python/integrations/otlp/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: OpenTelemetry (OTLP)
description: "Learn about using OTLP to automatically send OpenTelemetry Traces to Sentry."
keywords: ["otlp", "otel", "opentelemetry"]
---

The OTLP integration configures the Sentry SDK to automatically send trace data instrumented by an [OpenTelemetry](https://opentelemetry.io) SDK to Sentry's [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otel/protocol/) [ingestion endpoint](/concepts/otlp).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love links to all the information, but also having 3 in a row can make it hard to know what I'm focusing on. I suggest dropping the general one, as I assume people who land here will go to the protocol and then can dig in on otel.

Suggested change
The OTLP integration configures the Sentry SDK to automatically send trace data instrumented by an [OpenTelemetry](https://opentelemetry.io) SDK to Sentry's [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otel/protocol/) [ingestion endpoint](/concepts/otlp).
The OTLP integration configures the Sentry SDK to automatically send trace data instrumented by an OpenTelemetry SDK to Sentry's [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otel/protocol/) [ingestion endpoint](/concepts/otlp).


## Install

Install `sentry-sdk` from PyPI with the `opentelemetry-otlp` extra.

```bash {tabTitle:pip}
pip install "sentry-sdk[opentelemetry-otlp]"
```
```bash {tabTitle:uv}
uv add "sentry-sdk[opentelemetry-otlp]"
```

## Configure

You need to configure both the OpenTelemetry and Sentry SDKs to get trace data.

### OpenTelemetry

For the OpenTelemetry SDK, you need to [configure instrumentation](https://opentelemetry.io/docs/languages/python/getting-started/#instrumentation) as per your needs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the OpenTelemetry SDK, you need to [configure instrumentation](https://opentelemetry.io/docs/languages/python/getting-started/#instrumentation) as per your needs.
For the OpenTelemetry SDK, you need to [configure instrumentation](https://opentelemetry.io/docs/languages/python/getting-started/#instrumentation) you want to capture.


### Sentry

For the Sentry SDK, you simply need to enable our `OTLPIntegration` along with your existing configuration.

<OnboardingOptionButtons
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also call out tracing? It sounds like tracing is also auto opt-in like error monitoring, and we should show that.

Copy link
Member Author

@sl0thentr0py sl0thentr0py Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

people should not use our tracing when they use opentelemetry tracing, it's going to either or. Maybe we should clarify that?

Copy link
Contributor

@sfanahata sfanahata Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's a simple clarification. I added a suggestion in the behavior section below.

options={["error-monitoring", "logs"]}
/>

```python
import sentry_sdk
from sentry_sdk.integrations.otlp import OTLPIntegration

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
# ___PRODUCT_OPTION_START___ logs
# Enable logs to be sent to Sentry
enable_logs=True,
# ___PRODUCT_OPTION_END___ logs
integrations=[
OTLPIntegration(),
],
)
```

## Behavior

Under the hood, the `OTLPIntegration` will setup the following parts:

* A [`SpanExporter`](https://opentelemetry.io/docs/concepts/components/#exporters) that will automatically setup the OTLP ingestion endpoint from your Sentry DSN
Copy link
Contributor

@sfanahata sfanahata Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A [`SpanExporter`](https://opentelemetry.io/docs/concepts/components/#exporters) that will automatically setup the OTLP ingestion endpoint from your Sentry DSN
* A [`SpanExporter`](https://opentelemetry.io/docs/concepts/components/#exporters) that will automatically setup the OTLP ingestion endpoint from your Sentry DSN. This enables tracing in Sentry. **Note:** _Do not_ also set up tracing via the Python SDK.

* A [`Propagator`](https://opentelemetry.io/docs/concepts/context-propagation/#propagation) that ensures [distributed tracing](/concepts/key-terms/tracing/distributed-tracing/) works
* Trace/Span linking for all other Sentry events such as Errors, Logs, Crons and Metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to call out that Logs, Crons, and Metrics require additional config?


## Supported Versions

- Python: 3.7+
- opentelemetry-distro: 0.35b0+
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ description: "Using OpenTelemetry with Sentry Performance."
sidebar_order: 20
---

<Alert>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Alert>
<Alert title="New Integration Option">


We have a dedicated <PlatformLink to="/integrations/otlp"> OTLPIntegration </PlatformLink> now that can directly ingest OpenTelemetry Traces into Sentry. We recommend moving over to the new setup since it is much simpler.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We have a dedicated <PlatformLink to="/integrations/otlp"> OTLPIntegration </PlatformLink> now that can directly ingest OpenTelemetry Traces into Sentry. We recommend moving over to the new setup since it is much simpler.
We now have a dedicated <PlatformLink to="/integrations/otlp"> OTLPIntegration</PlatformLink> that can directly ingest OpenTelemetry Traces into Sentry. We recommend moving over to the new setup since it is much simpler.


</Alert>

You can configure your [OpenTelemetry SDK](https://opentelemetry.io/) to send traces and spans to Sentry.

## Install
Expand Down
Loading