Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
89c4850
docs(php): Add OTLP integration docs
dingsdax Jun 16, 2026
96cfc6f
docs(dotnet): Add OTLP integration docs
dingsdax Jun 16, 2026
2d7dd02
docs(symfony): Add OTLP integration docs
dingsdax Jun 16, 2026
3d63abb
docs(laravel): Add OTLP integration docs
dingsdax Jun 16, 2026
c6de0ee
docs(python): Mark legacy OpenTelemetryIntegration as deprecated
dingsdax Jun 16, 2026
17a1178
docs(dotnet): Add deprecation alert to legacy OTel page
dingsdax Jun 16, 2026
8540ee1
docs(otlp): Update hub page with all available OTLP integrations
dingsdax Jun 16, 2026
8434915
fix: Address review findings across OTLP docs
dingsdax Jun 16, 2026
4cece09
fix: Correct PHP version numbers and option names
dingsdax Jun 16, 2026
3e35289
fix(go,java): Correct stale version floors and propagator config
dingsdax Jun 16, 2026
d4ebc65
fix(dotnet): Align deprecated page title with Python/Ruby pattern
dingsdax Jun 16, 2026
a786a30
Merge branch 'master' into docs/otlp-integration-drift
dingsdax Jun 16, 2026
d348f6d
fix(php): Update broken OTel instrumentation links
dingsdax Jun 16, 2026
fefea65
fix(php): Add fallbackPlatform to PlatformLink in guide pages
dingsdax Jun 16, 2026
2596a60
Merge branch 'master' into docs/otlp-integration-drift
dingsdax Jun 16, 2026
fdad7fb
docs(otlp): Reorder hub page links by importance
dingsdax Jun 16, 2026
25ea04e
Update docs/platforms/dotnet/common/tracing/instrumentation/opentelem…
dingsdax Jun 17, 2026
bc773fb
Update platform-includes/performance/opentelemetry-install/go.mdx
dingsdax Jun 17, 2026
84d25a1
Update docs/platforms/dotnet/common/tracing/instrumentation/opentelem…
dingsdax Jun 17, 2026
a169877
docs(dotnet): Fix OTLP page sidebar order and package version
dingsdax Jun 17, 2026
ab536f9
Merge branch 'master' into docs/otlp-integration-drift
dingsdax Jun 17, 2026
316e59a
docs(otlp): Add planned removal notices for automatic propagator setup
dingsdax Jun 29, 2026
0487691
docs(otlp): Clarify exporter vs propagation across OTLP pages
dingsdax Jun 30, 2026
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
43 changes: 34 additions & 9 deletions docs/concepts/otlp/sentry-with-otel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,54 @@ The following SDKs support the `propagateTraceparent` option:

If you're running both a Sentry SDK and OTel instrumentation in the same backend service, use the OTLP Integration. This forces Sentry and OTel to share the same trace ID internally, so errors captured by Sentry are automatically linked to your OTLP traces.

- <LinkWithPlatformIcon
platform="python"
label="Python"
url="/platforms/python/integrations/otlp/"
/>
- <LinkWithPlatformIcon
platform="javascript.node"
label="Node.js"
url="/platforms/javascript/guides/node/install/lightweight/#using-with-opentelemetry-otlp"
/>
- <LinkWithPlatformIcon
platform="python"
label="Python"
url="/platforms/python/integrations/otlp"
platform="java"
label="Java"
url="/platforms/java/opentelemetry/setup/otlp/"
/>
- <LinkWithPlatformIcon
platform="ruby"
label="Ruby"
url="/platforms/ruby/integrations/otlp/"
platform="dotnet"
label=".NET"
url="/platforms/dotnet/tracing/instrumentation/opentelemetry-otlp/"
/>
Coming Soon:
- <LinkWithPlatformIcon
platform="go"
label="Go"
url="#otlp-integration"
url="/platforms/go/tracing/instrumentation/opentelemetry/"
/>
- <LinkWithPlatformIcon
platform="ruby"
label="Ruby"
url="/platforms/ruby/integrations/otlp/"
/>
- <LinkWithPlatformIcon
platform="php"
label="PHP"
url="#otlp-integration"
url="/platforms/php/integrations/otlp/"
/>
- <LinkWithPlatformIcon
platform="php.laravel"
label="Laravel"
url="/platforms/php/guides/laravel/integrations/otlp/"
/>
- <LinkWithPlatformIcon
platform="php.symfony"
label="Symfony"
url="/platforms/php/guides/symfony/integrations/otlp/"
/>

## Exporters, Event Linking, and Propagation

The OTLP Integration configures two things: an **exporter** that sends your completed OTel spans to Sentry, and **event linking** that attaches Sentry errors and logs to the active OTel trace so they appear on the right span in the trace waterfall.

**Cross-service trace propagation** — making Service A and Service B appear in the same distributed trace — is a separate concern handled by OTel's default W3C `traceparent` propagator. This is already active in any standard OTel SDK setup, so traces connect across services without additional Sentry configuration.
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: OpenTelemetry (OTLP)
description: "Learn about using OTLP to automatically send OpenTelemetry Traces to Sentry."
sidebar_order: 22
keywords: ["otlp", "otel", "opentelemetry"]
---

The OTLP exporter 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

Add the `Sentry.OpenTelemetry.Exporter` NuGet package to your project:

```shell {tabTitle:.NET Core CLI}
dotnet add package Sentry.OpenTelemetry.Exporter -v {{@inject packages.version('sentry.dotnet') }}
```

```powershell {tabTitle:Package Manager}
Install-Package Sentry.OpenTelemetry.Exporter -Version {{@inject packages.version('sentry.dotnet') }}
```

```shell {tabTitle:Paket CLI}
paket add Sentry.OpenTelemetry.Exporter --version {{@inject packages.version('sentry.dotnet') }}
```

This package includes the standard OpenTelemetry OTLP exporter as a transitive dependency.
Comment thread
dingsdax marked this conversation as resolved.

To instrument outgoing HTTP requests using OpenTelemetry, also install [`OpenTelemetry.Instrumentation.Http`](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.Http):

```shell {tabTitle:.NET Core CLI}
dotnet add package OpenTelemetry.Instrumentation.Http
```

```powershell {tabTitle:Package Manager}
Install-Package OpenTelemetry.Instrumentation.Http
```

## Configure

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

### OpenTelemetry

Set up a `TracerProvider` using `AddSentryOtlpExporter` with your DSN. This automatically configures the OTLP endpoint and authentication headers derived from the DSN.

```csharp
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("MyApp") // the name of your ActivitySource
.AddHttpClientInstrumentation()
.AddSentryOtlpExporter("___PUBLIC_DSN___")
.Build();
```

### Sentry

Initialize Sentry and call `UseOtlp()` to disable Sentry's built-in span creation in favor of OpenTelemetry tracing.

```csharp
SentrySdk.Init(options =>
{
options.Dsn = "___PUBLIC_DSN___";
options.UseOtlp();
});
```

## Behavior

Under the hood, the OTLP exporter sets up the following parts:

* An OTLP exporter that automatically configures the ingestion endpoint from your Sentry DSN. This enables tracing in Sentry. **Note:** _Do not_ also set up tracing via the Sentry SDK (i.e. do not set `TracesSampleRate`).
* A `SentryPropagator` that injects `sentry-trace` and `baggage` headers alongside the standard W3C `traceparent` for compatibility with services using Sentry's native tracing (see note below)
* Trace/Span linking for all other Sentry events such as Errors, Logs, and Metrics

Cross-service trace propagation uses OTel's default W3C `traceparent` headers and does not require additional configuration. See [Exporters, Event Linking, and Propagation](/concepts/otlp/sentry-with-otel/#exporters-event-linking-and-propagation) for details.

Calling `UseOtlp()` on `SentryOptions` sets `DisableSentryTracing = true`, which turns off Sentry's automatic span creation from `SentryHttpMessageHandler`, `DiagnosticSource` listener, and Entity Framework interception to avoid duplicate spans.

## Options

`AddSentryOtlpExporter` accepts the following parameters:

- `dsnString` (string):

Your Sentry DSN. The OTLP endpoint and authentication headers are derived from this automatically.

- `collectorUrl` (Uri, optional):

URL of your own OpenTelemetry collector. When set, the exporter will send traces to this URL instead of the Sentry OTLP endpoint derived from the DSN.

- `defaultTextMapPropagator` (TextMapPropagator, optional):

Override the default propagator. Defaults to `SentryPropagator`, which propagates `sentry-trace`, `baggage`, and W3C `traceparent` headers.

<Alert level="warning" title="Planned Removal">

The automatic propagator setup will be removed in the next major version. Configure propagators manually using the [OpenTelemetry propagation API](https://opentelemetry.io/docs/concepts/context-propagation/) instead.

</Alert>
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
title: OpenTelemetry Support
title: OpenTelemetry Support (Deprecated)
description: "Using OpenTelemetry with Sentry Performance."
sidebar_order: 20
sidebar_order: 21
---

<Alert level="warning" title="Deprecated">

The `Sentry.OpenTelemetry` SpanProcessor integration is deprecated in favor of the <PlatformLink to="/tracing/instrumentation/opentelemetry-otlp/">OTLP exporter</PlatformLink>, which sends OpenTelemetry traces directly to Sentry over OTLP. Migrate to the new `Sentry.OpenTelemetry.Exporter` package for a simpler setup.

</Alert>

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

## Install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_order: 20

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

<Alert title="Span Processor Deprecation">
<Alert level="warning" title="Span Processor Removed">

The legacy `sentryotel.NewSentrySpanProcessor()` integration is deprecated in `sentry-go`. Prefer OTLP export instead: use `sentryotlp.NewTraceExporter()` to send traces directly to Sentry, or use a standard OpenTelemetry exporter if you're sending data through an OpenTelemetry Collector.
The legacy `sentryotel.NewSentrySpanProcessor()` and `sentryotel.NewSentryPropagator()` were removed in `sentry-go` v0.47.0. Use `sentryotlp.NewTraceExporter()` to send traces directly to Sentry via OTLP, or use a standard OpenTelemetry exporter if you're sending data through an OpenTelemetry Collector.

</Alert>

Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/java/common/opentelemetry/setup/otlp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ AutoConfiguredOpenTelemetrySdk.builder()
properties.put("otel.exporter.otlp.traces.endpoint", "___OTLP_TRACES_URL___");
properties.put("otel.exporter.otlp.traces.protocol", "http/protobuf");
properties.put("otel.exporter.otlp.traces.headers", "x-sentry-auth=sentry sentry_key=___PUBLIC_KEY___");
properties.put("otel.propagators", "sentry");
properties.put("otel.propagators", "tracecontext,baggage,sentry");
properties.put("otel.logs.exporter", "none");
properties.put("otel.metrics.exporter", "none");
return properties;
Expand All @@ -95,7 +95,7 @@ Add the following to your `application.properties`:
```properties {tabTitle:application.properties}
sentry.dsn=___PUBLIC_DSN___

otel.propagators=sentry
otel.propagators=tracecontext,baggage,sentry
otel.traces.exporter=otlp
otel.exporter.otlp.traces.endpoint=___OTLP_TRACES_URL___
otel.exporter.otlp.traces.protocol=http/protobuf
Expand Down
75 changes: 75 additions & 0 deletions docs/platforms/php/common/integrations/otlp/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
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 SDK to Sentry's [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otel/protocol/) [ingestion endpoint](/concepts/otlp).

<Alert level="warning" title="Mutually Exclusive With Sentry Tracing">

Using Sentry tracing and OTLP tracing at the same time is not supported. If Sentry tracing is enabled (`traces_sample_rate`, `traces_sampler`, or `enable_tracing`), the integration will not be registered.

</Alert>

## Install

Install the required OpenTelemetry packages via Composer:

```bash
composer require \
open-telemetry/sdk \
open-telemetry/exporter-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/php/instrumentation/) you want to capture.

### Sentry

For the Sentry SDK, add the `OTLPIntegration` to your existing configuration.

```php
\Sentry\init([
'dsn' => '___PUBLIC_DSN___',
// Add data like request headers and IP for users, if applicable;
// see https://docs.sentry.io/platforms/php/data-management/data-collected/ for more info
'send_default_pii' => true,
'integrations' => [
new \Sentry\Integration\OTLPIntegration(),
],
]);
```

## Behavior

Under the hood, the `OTLPIntegration` sets up the following parts:

* A [`SpanExporter`](https://opentelemetry.io/docs/concepts/components/#exporters) that automatically configures the OTLP ingestion endpoint from your Sentry DSN. This enables tracing in Sentry. **Note:** _Do not_ also set up tracing via the PHP SDK (i.e. do not set `traces_sample_rate`, `traces_sampler`, or `enable_tracing`).
* Trace/Span linking for all other Sentry events such as Errors, Logs, and Metrics

Cross-service trace propagation uses OTel's default W3C `traceparent` headers and does not require additional configuration. See [Exporters, Event Linking, and Propagation](/concepts/otlp/sentry-with-otel/#exporters-event-linking-and-propagation) for details.

## Options

You can pass the following arguments to the `OTLPIntegration` constructor:

- `setupOtlpTracesExporter` (bool):

Automatically configure an Exporter to send OTLP traces to the right project from the DSN or `collectorUrl`, defaults to `true`.

Set to `false` to set up the TracerProvider manually.

- `collectorUrl` (string|null):

URL of your own OpenTelemetry collector. When set, the exporter will send traces to this URL instead of the Sentry OTLP endpoint derived from the DSN.

## Supported Versions

- PHP: 8.1+ (required by the OpenTelemetry SDK)
- sentry/sentry: 4.23.0+
61 changes: 61 additions & 0 deletions docs/platforms/php/guides/laravel/integrations/otlp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
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 SDK to Sentry's [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otel/protocol/) [ingestion endpoint](/concepts/otlp).

<Alert level="warning" title="Mutually Exclusive With Sentry Tracing">

Using Sentry tracing and OTLP tracing at the same time is not supported. If Sentry tracing is enabled (`traces_sample_rate`, `traces_sampler`, or `enable_tracing`), the integration will not be registered.

</Alert>

## Install

Install the required OpenTelemetry packages via Composer:

```bash
composer require \
sentry/sentry-laravel \
open-telemetry/sdk \
open-telemetry/exporter-otlp
Comment on lines +20 to +23

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The composer require command for the Laravel OTLP integration guide is missing the required version constraint for sentry/sentry-laravel, which can lead to installing an incompatible version.
Severity: MEDIUM

Suggested Fix

Update the composer require command in the Laravel OTLP integration guide to include the minimum version constraint. Change sentry/sentry-laravel to sentry/sentry-laravel:"^4.25". This ensures Composer installs a compatible version.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docs/platforms/php/guides/laravel/integrations/otlp.mdx#L20-L23

Potential issue: The Laravel OTLP integration documentation specifies that
`sentry/sentry-laravel: 4.25.0+` is required, but the provided `composer require`
command does not enforce this version. If a user's environment resolves to an older
version (e.g., due to an existing `composer.lock` file), they will install an
incompatible package. This will cause a `ClassNotFoundException` at runtime when the
application tries to use `\Sentry\Integration\OTLPIntegration`, which does not exist in
versions prior to 4.25.0.

```

## 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/php/instrumentation/) you want to capture.

### Sentry

Add the `OTLPIntegration` class to the `integrations` array in `config/sentry.php`:

```php {filename:config/sentry.php}
'integrations' => [
\Sentry\Integration\OTLPIntegration::class,
],
```

## Behavior

Under the hood, the `OTLPIntegration` sets up the following parts:

* A [`SpanExporter`](https://opentelemetry.io/docs/concepts/components/#exporters) that automatically configures the OTLP ingestion endpoint from your Sentry DSN. This enables tracing in Sentry. **Note:** _Do not_ also set up tracing via the PHP SDK (i.e. do not set `traces_sample_rate`, `traces_sampler`, or `enable_tracing`).
* Trace/Span linking for all other Sentry events such as Errors, Logs, and Metrics

Cross-service trace propagation uses OTel's default W3C `traceparent` headers and does not require additional configuration. See [Exporters, Event Linking, and Propagation](/concepts/otlp/sentry-with-otel/#exporters-event-linking-and-propagation) for details.

## Options

For details on available options (`setupOtlpTracesExporter`, `collectorUrl`), see the <PlatformLink to="/integrations/otlp/" fallbackPlatform="php">OTLP integration docs</PlatformLink>.

## Supported Versions

- PHP: 8.1+
- sentry/sentry-laravel: 4.25.0+
- open-telemetry/sdk: 1.0+
Loading
Loading