Conversation
Widgets that query for span.group can receive null values from the backend for OpenTelemetry-ingested spans, causing the page to crash. Add has:span.group to the search queries in overviewTimeConsumingQueriesWidget and overviewSlowNextjsSSRWidget, matching the pattern already used by overviewSlowAssetsWidget and overviewSlowQueriesChartWidget. Fixes DAIN-1467
Move SPAN_GROUP from NonNullableStringFields to NullableStringFields, reflecting the reality that OpenTelemetry-ingested spans can have null span.group values. This makes SpanResponse['span.group'] resolve to string | null, letting TypeScript catch unsafe usages. Fix all surfaced type errors by updating prop types to accept null and adding null coalescing where values are passed to MutableSearch.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Null group interpolated into navigation URL path
- Added a guard in QueryClippedBox so the click handler returns early when group is null/undefined instead of navigating to a malformed span URL.
Or push these changes by commenting:
@cursor push 00baa7392a
Preview (00baa7392a)
diff --git a/static/app/views/insights/common/components/fullSpanDescription.tsx b/static/app/views/insights/common/components/fullSpanDescription.tsx
--- a/static/app/views/insights/common/components/fullSpanDescription.tsx
+++ b/static/app/views/insights/common/components/fullSpanDescription.tsx
@@ -121,11 +121,16 @@
clipHeight={500}
buttonProps={{
icon: <IconOpen />,
- onClick: () =>
+ onClick: () => {
+ if (!group) {
+ return;
+ }
+
navigate({
pathname: `${databaseURL}/spans/span/${group}`,
query: {...location.query, isExpanded: true},
- }),
+ });
+ },
}}
>
{children}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Don't show "View full query" link in QueryClippedBox when group is null — navigating to /spans/span/null is not useful.
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 d011829. Configure here.
row.group can be null, so using it alone as a React key would cause duplicate keys. Use group + operation + index as a composite key.
nsdeschenes
left a comment
There was a problem hiding this comment.
Just one small nit/question, all looks good tho 😄
| const {query} = useTransactionNameQuery(); | ||
|
|
||
| const fullQuery = `span.op:function.nextjs ${query}`; | ||
| const fullQuery = `has:span.group span.op:function.nextjs ${query}`; |
There was a problem hiding this comment.
nit: Looking at .../widgets/overviewTimeConsumingQueriesWidget.tsx, you're using an enum value (has:${SpanFields.SPAN_GROUP}) whereas here you're using a raw string.
Is one better/preferred than the other?
There was a problem hiding this comment.
It's better to use the enum values because that makes it easier to find all usages of a specific attribute, but I always forget to do that! I can update
Use SpanFields.SPAN_GROUP and SpanFields.SPAN_OP instead of raw strings in overviewSlowNextjsSSRWidget for consistency and to make field usages easier to find via search.


A self-hosted user complained in getsentry/self-hosted#4262 that their Backend Insights view breaks when ingesting Otel data. This PR adds some guards to prevent this crash, but it doesn't necessarily guarantee a great experience, e.g.,
span.groupattribute, but decisions around OTel are changing! We might do less enrichment (or different enrichment) thereIn the meantime, this PR makes two changes
has:span.groupto be present in a few widgets. This is a common pattern for us, and should work here, toospan.groupproperty to mark it as possiblynulland updates a bunch of usageFixes DAIN-1467