Skip to content

fix(otlp): Add attribute aliases for span name and kind #93725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Jun 17, 2025

kind, name, and status are top-level fields in the Span V2 schema, and in the OTLP span schema. We expect users to be able to search for these fields in Explore with syntax like "name:GET*". In EAP, these fields are stored as sentry.kind and sentry.name respectively. This PR adds the aliases, with a span. prefix to disambiguate. span.status is already aliased to sentry.status

N.B. This PR also removes the reverse alias of from sentry.name to span.description from SPANS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS!

N.B.2. This is not feature-flagged but name, kind, and status aren't in the autocomplete for span searches, and that will be feature-flagged.

gggritso added 2 commits June 17, 2025 13:18
These fields are top-level fields in span V2, and we want users to be
able to search for them directly.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 17, 2025
@gggritso gggritso requested review from wmak and shruthilayaj June 17, 2025 18:28
@gggritso
Copy link
Member Author

@shruthilayaj I removed that reverse alias, since I needed it to make the name field to work properly, but I'm not sure why it was added. Is it safe to remove?

@gggritso gggritso marked this pull request as ready for review June 17, 2025 18:29
@gggritso gggritso requested a review from a team as a code owner June 17, 2025 18:29
@gggritso gggritso changed the title fix(otlp): Add attribute aliases for span name, kind, and status fix(otlp): Add attribute aliases for span name and kind Jun 17, 2025
We already have `span.status`, so let's do one thing at a time here.
@gggritso
Copy link
Member Author

Also, it seems like maybe these should be span.name and span.kind, since those are span-specific fields. Is that how we're doing this?

@shruthilayaj
Copy link
Member

@shruthilayaj I removed that reverse alias, since I needed it to make the name field to work properly, but I'm not sure why it was added. Is it safe to remove?

I think this should be safe to remove - it was temporarily needed while Pierre cleaned up the alias map on the EAP side (which has since been done). There were test failures last time, so if tests pass, you should be good.

@gggritso
Copy link
Member Author

@shruthilayaj @Zylphrex should these be called span.name and span.kind, or name and kind?

@Zylphrex
Copy link
Member

@shruthilayaj @Zylphrex should these be called span.name and span.kind, or name and kind?

That depends on how you'd like them to be exposed in the UI. Though I do think name and kind are too generic so prefixing them with span. is probably a good idea.

Also, does the OTLP span schema have any opinions how they should be exposed?

@gggritso
Copy link
Member Author

@Zylphrex I don't think OTel has any opinions on how the telemetry platforms do things, OTel only cares about sending the data! My opinion is that people should be able to recognize the data they sent and be able to guess how to find it, but IMO span.name is not too far of a stretch from name 🤷🏻‍♂️

@Zylphrex
Copy link
Member

If that's the case, then prefixing with span. sounds like a reasonable way to handle this.

@gggritso gggritso merged commit 89e6898 into master Jun 18, 2025
66 checks passed
@gggritso gggritso deleted the georgegritsouk/ope-38-add-aliases-for-spanname-spankind-and-spanstatus-fields branch June 18, 2025 11:57
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
`kind`, `name`, and `status` are top-level fields in the Span V2 schema,
and in the OTLP span schema. We expect users to be able to search for
these fields in Explore with syntax like `"name:GET*"`. In EAP, these
fields are stored as `sentry.kind` and `sentry.name` respectively. This
PR adds the aliases, with a `span.` prefix to disambiguate.
`span.status` is already aliased to `sentry.status`

N.B. This PR also removes the reverse alias of from `sentry.name` to
`span.description` from `SPANS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS`!

N.B.2. This is not feature-flagged but `name`, `kind`, and `status`
aren't in the autocomplete for span searches, and _that_ will be
feature-flagged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants