fix(span): Make _performance_issues_spans a top-level field#5870
fix(span): Make _performance_issues_spans a top-level field#5870
Conversation
jjbayer
commented
Apr 21, 2026
- sentry expects it as a top-level field, see https://github.com/getsentry/sentry/blob/70b3082b692723d5f7a561659b41274c2076bd38/src/sentry/spans/consumers/process_segments/message.py#L290.
- It is a temporary and internal feature flag that we do not want to document in sentry-conventions.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03ee6f7. Configure here.
Consolidate performance issues spans and remove deprecated config.
| skip_serialization = "empty", | ||
| trim = false | ||
| )] | ||
| pub performance_issues_spans: Annotated<bool>, |
There was a problem hiding this comment.
Why does this need to be top level and not an attribute (what it already is)? Can we instead change the consumer code?
I feel like this may set a bad precedent where we start adding things top level.
There was a problem hiding this comment.
It can be. Then we need to define it in conventions and adjust the consuming code accordingly.
There was a problem hiding this comment.
It's using an _internal attribute right now, we decided not to define these in conventions.
That being said, _internal is also not the best option here, but I think it's fine if we tackle this separately (or not at all considering there is a plan to remove it alltogether)
|
I will check if we can easily make this part of |
| /// When the flag is set to true, performance issues will be detected on this span provided it | ||
| /// is a root (segment) instead of the transaction event. | ||
| /// | ||
| /// Only set on root spans extracted from transactions. |
There was a problem hiding this comment.
| /// When the flag is set to true, performance issues will be detected on this span provided it | |
| /// is a root (segment) instead of the transaction event. | |
| /// | |
| /// Only set on root spans extracted from transactions. | |
| /// By default, performance issues are detected on transactions. When this flag is | |
| /// `true` and the span is a segment (root) span, detection runs on this span instead — this | |
| /// lets Sentry migrate detection from the legacy transaction-event pipeline to the new | |
| /// standalone-spans (EAP) pipeline without double-reporting issues. | |
| /// | |
| /// This flag is only meaningful on segment (root) spans that originated from a transaction event. |
There was a problem hiding this comment.
Found the original phrasing ambiguous, but maybe I just lack context
| /// | ||
| /// Only set on root spans extracted from transactions. | ||
| #[metastructure( | ||
| field = "_performance_issues_spans", |
There was a problem hiding this comment.
Should a top level field be underscored?
Lift the temporary `_performance_issues_spans` flag out of the SpanV2 protocol body and onto the Kafka envelope (`SpanMeta`). The on-the-wire JSON key is unchanged because `SpanMeta` and the span body are flattened into the same object. The legacy V1 path reads the value off `SpanV1` before conversion and forwards it on `StoreSpanV2`; the native V2 path hardcodes false (it never sets this flag). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| routing_key, | ||
| retention_days: ctx.retention.standard, | ||
| downsampled_retention_days: ctx.retention.downsampled, | ||
| performance_issues_spans: false, |
There was a problem hiding this comment.
| performance_issues_spans: false, | |
| performance_issues_spans: false, // only used for legacy spans |
| /// | ||
| /// Travels on the Kafka envelope (`SpanMeta`) rather than the SpanV2 body. |
There was a problem hiding this comment.
| /// | |
| /// Travels on the Kafka envelope (`SpanMeta`) rather than the SpanV2 body. |
| /// When the flag is set to true, performance issues will be detected on this span provided it | ||
| /// is a root (segment) instead of the transaction event. |
There was a problem hiding this comment.
| /// When the flag is set to true, performance issues will be detected on this span provided it | |
| /// is a root (segment) instead of the transaction event. | |
| /// When the flag is set to true, performance issues will be detected on this span | |
| /// instead of the transaction event (provided it is a segment span). |
| was_transaction, | ||
| kind, | ||
| performance_issues_spans, | ||
| performance_issues_spans: _, // moved to SpanMeta on the Kafka envelope |
There was a problem hiding this comment.
| performance_issues_spans: _, // moved to SpanMeta on the Kafka envelope | |
| performance_issues_spans: _, // not part of the V2 protocol (but still used by `legacy_spans::store::convert`). |
| - Retry failing objectstore requests. ([#5836](https://github.com/getsentry/relay/pull/5836)) | ||
| - Add mobile normalizations to SpanV2 processing pipeline (mobile tag, main thread, outlier filtering, app start backfill from V1 transactions, device class). ([#5824](https://github.com/getsentry/relay/pull/5824)) | ||
| - Remove the deprecated `aiModelCosts` global config, superseded by `aiModelMetadata`. ([#5862](https://github.com/getsentry/relay/pull/5862)) | ||
| - Make `_performance_issues_spans` a top-level field. ([#5870](https://github.com/getsentry/relay/pull/5870)) |
There was a problem hiding this comment.
| - Make `_performance_issues_spans` a top-level field. ([#5870](https://github.com/getsentry/relay/pull/5870)) | |
| - Make `_performance_issues_spans` a top-level field on the Kafka message. ([#5870](https://github.com/getsentry/relay/pull/5870)) |
