ref(insights): Replace span.op and span.description with span.name#112788
ref(insights): Replace span.op and span.description with span.name#112788obostjancic wants to merge 6 commits intomasterfrom
Conversation
… agent/MCP/conversations monitoring As span.op and span.description are deprecated in favor of span.name, update all references across the agent monitoring, MCP monitoring, and conversations UI to use span.name as the primary field. - Conversations: Update ConversationApiSpan interface to use span.name as required field, with span.description and span.op as optional fallbacks. Update isGenAiSpan and createNodeFromApiSpan to use span.name. - Agent monitoring: Update replaceRawSearchKeys and toolsTable explore URL fields from span.description to span.name. - MCP monitoring: Replace all span.op:mcp.server query filters with span.name:mcp.server across overview table, sub-tables, and 11 widget components. Update SpanFields.SPAN_DESCRIPTION references to SpanFields.NAME. Update explore URL fields. - Tests: Update useConversation.spec.tsx fixtures to use span.name. https://claude.ai/code/session_01RFw8EcGNBPjDZnwR4DZa3J
…ationTypeFromSpanName Update the function name and parameter to reflect the migration from span.op to span.name. Update all callers in trace view, AI trace nodes, and conversations. Update getIsMCPNode to check value.name instead of node.op. Add tests for the renamed function. https://claude.ai/code/session_01RFw8EcGNBPjDZnwR4DZa3J
…p-and-spandescription-as-a-primary-field
static/app/views/performance/newTraceDetails/traceRow/traceEAPSpanRow.tsx
Outdated
Show resolved
Hide resolved
constantinius
left a comment
There was a problem hiding this comment.
The Sentry bot comment seems legit
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: MCP overview table shows identical "mcp.server" for all rows
- Updated SpanNameCell to display unique tool/prompt names and added proper filters to drilldown links to differentiate each row.
- ✅ Fixed: Function receives
node.opinstead of span name- Changed getGenAiOpType and getAIEnhancedDescription to correctly pass node.value.name instead of node.op to getGenAiOperationTypeFromSpanName.
Or push these changes by commenting:
@cursor push 40afe4f06c
Preview (40afe4f06c)
diff --git a/static/app/views/insights/pages/agents/utils/aiTraceNodes.tsx b/static/app/views/insights/pages/agents/utils/aiTraceNodes.tsx
--- a/static/app/views/insights/pages/agents/utils/aiTraceNodes.tsx
+++ b/static/app/views/insights/pages/agents/utils/aiTraceNodes.tsx
@@ -66,7 +66,7 @@
return (
(attributeObject?.[SpanFields.GEN_AI_OPERATION_TYPE] as string | undefined) ??
- getGenAiOperationTypeFromSpanName(node.op)
+ getGenAiOperationTypeFromSpanName(node.value.name)
);
}
diff --git a/static/app/views/insights/pages/mcp/components/mcpOverviewTable.tsx b/static/app/views/insights/pages/mcp/components/mcpOverviewTable.tsx
--- a/static/app/views/insights/pages/mcp/components/mcpOverviewTable.tsx
+++ b/static/app/views/insights/pages/mcp/components/mcpOverviewTable.tsx
@@ -186,6 +186,12 @@
const search = new MutableSearch('');
search.addFilterValue(SpanFields.NAME, spanName);
+ if (toolName) {
+ search.addFilterValue(SpanFields.MCP_TOOL_NAME, toolName);
+ }
+ if (promptName) {
+ search.addFilterValue(SpanFields.MCP_PROMPT_NAME, promptName);
+ }
const link = getExploreUrl({
organization,
selection,
@@ -200,5 +206,6 @@
sort: '-count(span.duration)',
field: fields,
});
- return <Link to={link}>{spanName}</Link>;
+ const displayName = toolName || promptName || spanName;
+ return <Link to={link}>{displayName}</Link>;
}
diff --git a/static/app/views/performance/newTraceDetails/traceRow/traceEAPSpanRow.tsx b/static/app/views/performance/newTraceDetails/traceRow/traceEAPSpanRow.tsx
--- a/static/app/views/performance/newTraceDetails/traceRow/traceEAPSpanRow.tsx
+++ b/static/app/views/performance/newTraceDetails/traceRow/traceEAPSpanRow.tsx
@@ -36,7 +36,7 @@
const opType =
(attrs[SpanFields.GEN_AI_OPERATION_TYPE] as string | undefined) ??
- getGenAiOperationTypeFromSpanName(node.op);
+ getGenAiOperationTypeFromSpanName(node.value.name);
if (!opType) {
return undefined;This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
static/app/views/insights/pages/mcp/components/mcpOverviewTable.tsx
Outdated
Show resolved
Hide resolved
… overview table - Pass node.value.name instead of node.op to getGenAiOperationTypeFromSpanName in aiTraceNodes.tsx and traceEAPSpanRow.tsx, matching the function's contract - Revert MCP overview table to use span.description for grouping/display since span.name is always 'mcp.server' for all MCP spans, making rows indistinguishable
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 1a73039. Configure here.
|
🙏🏻 don't forget the files in |
Update the MCP prebuilt dashboard filters to use span.name for mcp.server. This keeps the prebuilt dashboards aligned with the field migration on this branch so the default queries continue to return MCP data. Refs TET-2070 Co-Authored-By: Codex <noreply@openai.com>
Sentry Snapshot Testing
|
| op: apiSpan['span.name'], | ||
| description: apiSpan['span.name'], |
There was a problem hiding this comment.
Bug: Both op and description are set to span.name. If span.name is a human-readable string, it will be incorrectly displayed as the operation type in the UI.
Severity: MEDIUM
Suggested Fix
Restore the previous behavior of using a dedicated field for the operation type, such as span.op, for the op property of the trace node. The description property can continue to use span.name or a more appropriate description field if available. This will ensure the operation type badge displays a technical identifier while the description shows the human-readable name.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
static/app/views/insights/pages/conversations/hooks/useConversation.tsx#L92-L93
Potential issue: In `useConversation.tsx`, both the `op` and `description` fields for a
trace node are assigned the value of `apiSpan['span.name']`. Test data confirms that
`span.name` can contain either a technical operation identifier (e.g.,
`'gen_ai.generate'`) or a human-readable name (e.g., `'My AI Agent'`). The UI component
`traceEAPSpanRow.tsx` renders the `op` field directly in a badge intended for operation
types. This will cause human-readable names to be displayed in the operation type badge,
which is semantically incorrect and degrades the trace visualization. The previous
distinction between operation and description is lost.


Summary
span.opandspan.descriptionwithspan.nameas the primary field across agent monitoring, MCP monitoring, and conversations UIConversationApiSpaninterface to makespan.namerequired, withspan.descriptionandspan.opas optional fallbacksspan.op:mcp.serverquery filters tospan.name:mcp.serveracross MCP tables and 11 widget componentsreplaceRawSearchKeysfrom['span.description', 'span.name']to['span.name']in all three monitoring areasSpanFields.SPAN_DESCRIPTIONwithSpanFields.NAMEin MCP overview table columns and explore URL fieldsspan.namefixtures