pub fn otel_to_sentry_span_v1(
otel_span: Span,
resource: Option<&Resource>,
scope: Option<&InstrumentationScope>,
) -> SpanExpand description
Transforms an OTEL span to a Sentry span.
This uses attributes in the OTEL span to populate various fields in the Sentry span.
- The Sentry span’s
namefield may be set based ondborhttpattributes if the OTEL span’snameis empty. - The Sentry span’s
opfield will be inferred based on the OTEL span’ssentry.opattribute, or other available attributes ifsentry.opis not provided. - The Sentry span’s
descriptionfield will be inferred based on the OTEL span’ssentry.descriptionattribute, or other available attributes ifsentry.descriptionis not provided. - The Sentry span’s
statusfield is set based on the OTEL span’sstatusfield andhttp.status_codeandrpc.grpc.status_codeattributes. attribute, or the difference between the start and end timestamp if that attribute is not set. - The Sentry span’s
platformfield is set based on the OTEL span’ssentry.platformattribute. - The Sentry span’s
profile_idfield is set based on the OTEL span’ssentry.profile_idattribute. - The Sentry span’s
segment_idfield is set based on the OTEL span’ssentry.segment.idattribute.
All other attributes are carried over from the OTEL span to the Sentry span’s data.