Skip to content

Ensure Span attributes are mapped to correct properties in JSON spans #10272

Closed as not planned
@Lms24

Description

@Lms24

Currently, all values in Span._attributes are merged with Span.data and put into the data attribute of a JSON span.

Plan for v8:
We use span attributes as a replacement for setting tags or dedicated fields onto a span. For example:

The consequences:

  • Some fields are duplicated:
    • jsonSpan.op & `jsonSpan.data['sentry.op']
    • jsonSpan.origin & `jsonSpan.data['sentry.origin']
  • New fields end up in span.context.trace
    • sentry.op and sentry.origin
    • Is this problematic or just unnecessary/redundant data?
  • Entries in span.tags are (would in the future be) only set on span.data

Solution

I think as long as our backend doesn't handle picking specific keys from span.data (I have no idea what it does with these currently) to handle them like they were tags, we need to map back things to the original span JSON payloads.

But how are we going to do this reliably?

  • sentry.op and sentry.origin can probably stay duplicated in span.data(?)
  • sentry.op and sentry.origin don't need to be sent in trace context. But does it hurt us sending them still?
  • but tags should still be mapped to span.tags
    • do we need to prefix the attribute keys? e.g. http.status_code --> tag.http.status_code? Might work for our internal tags but user tags?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions