OpenTelemetry Protocol (OTLP)
Learn how to send OpenTelemetry trace data directly to Sentry from OpenTelemetry SDKs.
This feature is in beta and is only available if your organization is participating in its limited release. Please reach out to feedback-tracing@sentry.io if you want access. Features in beta are still in-progress and may have bugs. We recognize the irony.
Sentry can ingest OpenTelemetry traces directly via the OpenTelemetry Protocol. If you have an existing OpenTelemetry trace instrumentation, you can configure your OpenTelemetry exporter to send traces to Sentry directly. Sentry's OTLP ingestion endpoint is currently in development, and has a few known limitations:
- Span events are not supported. All span events are dropped during ingestion.
- Span links are partially supported. We ingest and display span links, but they cannot be searched, filtered, or aggregated. Links are are shown in the Trace View.
- Array attributes are partially supported. We ingest and display array attributes, but they cannot be searched, filtered, or aggregated. Array attributes are shown in the Trace View.
- Sentry does not support ingesting OTLP metrics or OTLP logs.
The easiest way to configure an OpenTelemetry exporter is with environment variables. You'll need to configure the trace endpoint URL, as well as the authentication headers. Set these variables on the server where your application is running.
.env
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://o0.ingest.sentry.io/api/0/otlp/v1/traces""
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="x-sentry-auth=sentry sentry_key=examplePublicKey"
Alternatively, you can configure the OpenTelemetry Exporter directly in your application code. Here is an example with the OpenTelemetry Node SDK:
app.ts
import { NodeSDK } from "@opentelemetry/sdk-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
const sdk = new NodeSDK({
traceExporter: new OTLPTraceExporter({
url: "https://o0.ingest.sentry.io/api/0/otlp/v1/traces",
headers: {
"x-sentry-auth": "sentry sentry_key=examplePublicKey",
},
}),
});
sdk.start();
You can find the values of Sentry's OTLP endpoint and public key in your Sentry project settings.
- Go to the Settings > Projects page in Sentry.
- Select a project from the list.
- Go to the "Client Keys (DSN)" sub-page for this project under the "SDK Setup" heading.
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").