Repository navigation
feat(spans): Reintroduce OTLP endpoint - #4223
Conversation
| .route("/api/:project_id/minidump/", minidump::route(config)) | ||
| .route("/api/:project_id/events/:event_id/attachments/", post(attachments::handle)) | ||
| .route("/api/:project_id/unreal/:sentry_key/", unreal::route(config)) | ||
| .route("/api/:project_id/traces-data/", traces_data::route(config)) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Why is it currently "traces-data"?
There was a problem hiding this comment.
In the previous impl it was /spans/ i wanted to name it after the data type it accepts (TracesData) to be consistent with /minidump/, /csp-report/, etc. But reading the link above a bit more, we should maybe even name it /otel/v1/traces/ to be future proof.
For OTLP/HTTP, exporters in the SDK construct signal-specific URLs when this environment variable is set. This means that if you’re sending traces, metrics, and logs, the following URLs are constructed from the example above:
Traces: "http://my-api-endpoint/v1/traces"
Metrics: "http://my-api-endpoint/v1/metrics"
Logs: "http://my-api-endpoint/v1/logs"
| .route("/api/:project_id/minidump/", minidump::route(config)) | ||
| .route("/api/:project_id/events/:event_id/attachments/", post(attachments::handle)) | ||
| .route("/api/:project_id/unreal/:sentry_key/", unreal::route(config)) | ||
| .route("/api/:project_id/traces-data/", traces_data::route(config)) |
There was a problem hiding this comment.
Why is it currently "traces-data"?
|
Converting back to draft, unclear if needed. |
resolves #5111 Building on top of #5128, this PR adds an OTLP endpoint for logs. Much of this approach was inspired by #4223. To use this endpoint, you'll need to provide the following environmental variables (where `DSN_PROJECT_ID` and `DSN_PUBLIC_KEY` are grabbed from the DSN) when setting up your OTEL setup. An integration test was added to `tests/integration/test_otlp_logs.py` to show this working. ```sh OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="https://{HOST}/api/{DSN_PROJECT_ID}/otlp/v1/logs" OTEL_EXPORTER_OTLP_HEADERS="x-sentry-auth=sentry sentry_key={DSN_PUBLIC_KEY}" ```
Restore the OTLP endpoint that was removed in #3973.
This PR moves the parsing of the trace data to the processor to ensure fast response times.
I also renamed the endpoint from
/spans/to/otlp/v1/traces/to be consistent with https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_endpoint.fixes: https://github.com/getsentry/team-ingest/issues/569