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. 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 existing OpenTelemetry trace instrumentation, you can configure your OpenTelemetry exporter to send traces to Sentry directly.
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.
.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"
If you don't want to use environment variables, you can configure the OpenTelemetry Exporter directly in your application code.
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").