OpenTelemetry Support
This page is under active development. Specifications are not final and subject to change.
"Proof is in the progress" - Drake
This document details Sentry's work in integrating and supporting OpenTelemetry, the open standard for metrics, traces and logs. In particular, it focuses on the integration between Sentry's performance monitoring product and OpenTelemetry's tracing spec.
Background
When Sentry performance monitoring was initially introduced, OpenTelemetry was in early stages. This lead to us adopt a slightly different model from OpenTelemetry, notably we have this concept of transactions that OpenTelemetry does not have. We've described this, and some more historical background, in our performance monitoring research document.
TODO: Add history about OpenTelemetry Sentry Exporter: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sentryexporter
Approach
TODO: Talk about the approach we are using, based on Matt's hackweek project - https://github.com/getsentry/sentry-ruby/pull/1876
Protocol
Transaction Protocol
TODO: Talk about generating transactions
Span Protocol
Below describe the transformations between an OpenTelemetry span and a Sentry Span. Related: the interface for a Sentry Span, the Relay spec for a Sentry Span and the spec for an OpenTelemetry span.
This is based on a mapping done as part of work on the OpenTelemetry Sentry Exporter.
OpenTelemetry Span | Sentry Span | Note |
---|---|---|
Span.TraceID | Span.trace_id | |
Span.SpanID | Span.span_id | |
Span.ParentSpanID | Span.parent_span_id | |
Span.ParentSpanID | Span.parent_span_id | If a span does not have a parent span ID, it is a root span. For a root span: |
Span.Name, Span.Attributes, Span.Kind | Span.description | The span description is decided using OpenTelemetry Semantic Conventions. Generally, the OpenTelemetry Span.Name maps to a Sentry Span.description. |
Span.Name, Span.Attributes, Span.Kind | Span.op |
- TODO: Talk about generating stuff (breadcrumbs/error events) from Span Events: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/48ee3288c030ed32374125190a8abf7ced1a4238/exporter/sentryexporter/sentry_exporter.go#L167-L202
Semantic Conventions
Using the Span.Name, Span.Attributes, and Span.Kind of OpenTelemetry Spans, we can generate ops, descriptions, and tags. This exact mapping is described below.
TODO: Talk about what we do here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/48ee3288c030ed32374125190a8abf7ced1a4238/exporter/sentryexporter/sentry_exporter.go#L226-L267
SDK Spec
- SpanProcessor: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#span-processor
- Propogator: https://opentelemetry.io/docs/reference/specification/context/api-propagators/