feat(core): Remove kind for spans, move to sentry.kind attribute#22528
feat(core): Remove kind for spans, move to sentry.kind attribute#22528mydea wants to merge 4 commits into
kind for spans, move to sentry.kind attribute#22528Conversation
| /** An op for the span. This is a categorization for spans. */ | ||
| op?: string; | ||
|
|
||
| /** |
There was a problem hiding this comment.
Public API broken without deprecation
High Severity
This removes public surface without a deprecation path in a v10 minor: the kind option on StartSpanOptions, the SPAN_KIND / SpanKindValue exports from @sentry/core, and getSpanKind from @sentry/opentelemetry. The review rules require deprecation notices for public API removals and signature changes. Flagged because it was mentioned in this rules file.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 973aafc. Configure here.
There was a problem hiding this comment.
need to add deprecation in follow up
| attributes: { | ||
| ...opts.attributes, | ||
| [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', | ||
| ...(op ? { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op } : {}), |
There was a problem hiding this comment.
Deno tracer drops kind mapping
Medium Severity
The Deno OTel shim no longer maps SpanOptions.kind to an op or to sentry.kind. Callers using OpenTelemetry SpanKind.CLIENT / SERVER (and friends) previously got http.client / http.server ops; those spans now lose that classification, and inference cannot recover it without sentry.kind.
Reviewed by Cursor Bugbot for commit 973aafc. Configure here.
There was a problem hiding this comment.
this was totally incorrect anyhow, simply removing this...
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
There are 5 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0863e20. Configure here.
|
|
||
| const kind = getSpanKind(span); | ||
| return inferSpanData(name, attributes, kind); | ||
| return inferSpanData(name, attributes); |
There was a problem hiding this comment.
OTel span kind ignored in inference
High Severity
inferSpanData now reads kind only from the sentry.kind attribute, but classic OTel SDK spans keep kind on the span's .kind property and never set that attribute. With BasicTracerProvider / SentrySpanProcessor, HTTP ops fall back to bare http instead of http.server/http.client, and streamed backfill plus sampler inference lose kind entirely. spanExporter.getData still emits sentry.kind later, so the payload can look correct while op/source inference is already wrong.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 0863e20. Configure here.
| // Convert otel kind to our sentry.kind attribtue | ||
| if (options.kind) { | ||
| sentryOptions.attributes[SENTRY_KIND] = spanKindToName(options.kind); | ||
| } |
There was a problem hiding this comment.
Caller attributes object mutated
Medium Severity
_startSentrySpan reuses the caller's options.attributes object and then writes sentry.kind onto it. Any shared attributes object passed into startSpan is mutated for later callers, which can leak kind across unrelated spans.
Reviewed by Cursor Bugbot for commit 0863e20. Configure here.
| hook: 'preprocessSpan', | ||
| callback: (streamedSpanJSON: StreamedSpanJSON, hint?: { spanKind?: number }) => void, | ||
| ): () => void; | ||
| public on(hook: 'preprocessSpan', callback: (streamedSpanJSON: StreamedSpanJSON) => void): () => void; |
There was a problem hiding this comment.
preprocessSpan hint removed undeprecated
Medium Severity
The public preprocessSpan hook no longer accepts the { spanKind } hint argument. External subscribers typing or depending on that second parameter break without a deprecation path. Flagged because it was mentioned in the PR review rules file.
Additional Locations (1)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 0863e20. Configure here.


This removes
kindfrom start span options, and refactors all our usage to instead set thesentry.kindattribute directly.This is one of the things we rely on for span description inferral, so removing this takes us a step closer to this.
While at it, this also aligns the values to actually be lowercase as specced.