Skip to main content

span_v1_to_span_v2

Function span_v1_to_span_v2 

Source
pub fn span_v1_to_span_v2(span_v1: Span, infer_name: bool) -> SpanV2
Expand description

Converts a legacy span to the new Span V2 schema.

  • tags, sentry_tags, measurements and data are transferred to attributes.
  • Nested data items are encoded as JSON.

Measurements are converted to attributes by looking up the replacement attribute’s name in sentry-conventions.

infer_name controls whether the span’s name is inferred based on its attributes. Only enable it if the source span has gone through PII scrubbing, otherwise the name might end up containing PII that doesn’t get scrubbed later!