---
title: "OpenTelemetry (OTLP)"
description: "Learn about using OTLP to automatically send OpenTelemetry Traces to Sentry."
url: https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp/
---

# OpenTelemetry (OTLP) | Sentry for AWS Lambda

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](https://docs.sentry.io/concepts/otlp.md).

## [Install](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#install)

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

```shell
dotnet add package Sentry.OpenTelemetry.Exporter -v 6.6.0
```

*Other available variations of the above snippet: Package Manager, Paket CLI*

This package includes the standard OpenTelemetry OTLP exporter as a transitive dependency.

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

```shell
dotnet add package OpenTelemetry.Instrumentation.Http
```

*Other available variations of the above snippet: Package Manager*

## [Configure](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#configure)

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

### [OpenTelemetry](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#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("https://<key>@o<orgId>.ingest.sentry.io/<projectId>")
    .Build();
```

### [Sentry](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#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 = "https://<key>@o<orgId>.ingest.sentry.io/<projectId>";
    options.UseOtlp();
});
```

## [Behavior](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#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
* Trace/Span linking for all other Sentry events such as Errors, Logs, and Metrics

##### 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.

Cross-service trace propagation uses OTel's default W3C `traceparent` headers and does not require additional configuration. See [Exporters, Event Linking, and Propagation](https://docs.sentry.io/concepts/otlp/sentry-with-otel.md#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](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#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. This option will be removed alongside the automatic propagator setup in the next major version.

## [Supported Versions](https://docs.sentry.io/platforms/dotnet/guides/aws-lambda/tracing/instrumentation/opentelemetry-otlp.md#supported-versions)

* .NET: 8.0+ / .NET Standard 2.0+ / .NET Framework 4.6.2+
* Sentry: 6.5.0+
* OpenTelemetry: 1.10.0+
