pub fn otel_to_sentry_span(otel_span: Span) -> Result<Span, Error>
Expand 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
name
field may be set based ondb
orhttp
attributes if the OTEL span’sname
is empty. - The Sentry span’s
op
field will be inferred based on the OTEL span’ssentry.op
attribute, or other available attributes ifsentry.op
is not provided. - The Sentry span’s
description
field will be inferred based on the OTEL span’ssentry.description
attribute, or other available attributes ifsentry.description
is not provided. - The Sentry span’s
status
field is set based on the OTEL span’sstatus
field andhttp.status_code
andrpc.grpc.status_code
attributes. - The Sentry span’s
exclusive_time
field is set based on the OTEL span’sexclusive_time_nano
attribute, or the difference between the start and end timestamp if that attribute is not set. - The Sentry span’s
platform
field is set based on the OTEL span’ssentry.platform
attribute. - The Sentry span’s
profile_id
field is set based on the OTEL span’ssentry.profile.id
attribute. - The Sentry span’s
segment_id
field is set based on the OTEL span’ssentry.segment.id
attribute.
All other attributes are carried over from the OTEL span to the Sentry span’s data
.