Add Native OTLP Ingestion
Problem Statement
Announcement: https://github.com/getsentry/sentry/discussions/85902#discussioncomment-14568258 Product docs: https://docs.sentry.io/concepts/otlp/
Solution Brainstorm
The way we'll tell you how to configure this should be versioned (learned this the hard way from User Feedback feature). Grab the version you're currently on (or if yours is higher than any of these, choose the highest one).
Setup Guide for 25.8.0
You will need to have Performance Trace Explorer & Event Analytics Platform enabled. See #3592 on how to enable that.
Modify sentry.conf.py:
SENTRY_FEATURES = # ...
) +
# Native OpenTelemetry Ingestion
(
"organizations:standalone-span-ingestion",
"performance-otel-friendly-ui",
"projects:span-metrics-extraction",
"projects:relay-otel-endpoint", # Required
)
Re-run ./install.sh since the changes should be on containers that uses the sentry image and relay.
How to use this
- Create a Sentry project from the web UI
- Copy the generated DSN, it have the format of:
https://{{ DSN_KEY }}@sentry.example.com/{{ PROJECT_ID }} - Setup OpenTelemetry tracing on your application. Usually, you can configure it with environment variables, you need to set these 2:
Example in Go:OTEL_EXPORTER_OTLP_ENDPOINT=https://sentry.example.com OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://sentry.example.com/api/{{ PROJECT_ID }}/otlp/v1/traces OTEL_EXPORTER_OTLP_TRACES_HEADERS="x-sentry-auth=sentry sentry_key={{ DSN_KEY }}"
Example in Node.js:func newTracerProvider() (*trace.TracerProvider, error) { traceExporter, err := otlptracehttp.New( context.TODO(), otlptracehttp.WithEndpointURL("https://sentry.example.com/api/{{ PROJECT_ID }}/otlp/v1/traces"), otlptracehttp.WithHeaders(map[string]string{"x-sentry-auth": "sentry sentry_key={{ DSN_KEY }}"}) ) if err != nil { return nil, err } tracerProvider := trace.NewTracerProvider( trace.WithBatcher(traceExporter, trace.WithBatchTimeout(time.Second)), ) return tracerProvider, nil }import { NodeSDK } from "@opentelemetry/sdk-node"; import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"; const sdk = new NodeSDK({ traceExporter: new OTLPTraceExporter({ url: "https://sentry.example.com/api/{{ PROJECT_ID }}/otlp/v1/traces", headers: { "x-sentry-auth": "sentry sentry_key={{ DSN_KEY }}", }, }), }); sdk.start();
If you are using a reverse proxy, make sure that this endpoint is on the allowlist.
Setup Guide for 25.10.0
Skipped 25.9.0 because people break things often. Make sure to have Performance Trace Explorer + Event Analytics Platform enabled.
Modify sentry.conf.py:
SENTRY_FEATURES = # ...
) +
# Native OpenTelemetry Ingestion
(
"organizations:performance-otel-friendly-ui",
"organizations:relay-otlp-traces-endpoint",
"organizations:relay-otel-logs-endpoint",
)
Re-run ./install.sh since the changes should be on containers that uses the sentry image and relay.
How to use this
Usage docs: https://docs.sentry.io/concepts/otlp/
If you're behind a reverse proxy to gate this endpoint, make sure to allow:
https://sentry.example.com/api/{\d+}/integration/otlp/v1/traceshttps://sentry.example.com/api/{\d+}/integration/otlp/v1/logs