Skip to content

Commit eeef3a2

Browse files
authored
fix(trace-view): Improve OTLP span display (#101208)
If a span name isn't present (e.g. for spans from a transaction), we generate one - the final fallback being to duplicate the span `op`. In the trace view, rather than show duplicated information when the `op` and `name` match, fallback to the description (which typically contains more information).
1 parent 1041e34 commit eeef3a2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/description.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ export function SpanDescription({
100100
return formatter.toString(dbQueryText ?? span.description ?? '');
101101
}, [span.description, resolvedModule, dbSystem, dbQueryText]);
102102

103-
const exploreAttributeName = shouldUseOTelFriendlyUI
103+
const exploreUsingName = shouldUseOTelFriendlyUI && span.name !== span.op;
104+
const exploreAttributeName = exploreUsingName
104105
? SpanFields.NAME
105106
: SpanFields.SPAN_DESCRIPTION;
106-
const exploreAttributeValue = shouldUseOTelFriendlyUI ? span.name : span.description;
107+
const exploreAttributeValue = exploreUsingName ? span.name : span.description;
107108

108109
const actions = exploreAttributeValue ? (
109110
<BodyContentWrapper
@@ -194,7 +195,7 @@ export function SpanDescription({
194195
node={node}
195196
attributes={attributes}
196197
/>
197-
) : shouldUseOTelFriendlyUI && span.name ? (
198+
) : shouldUseOTelFriendlyUI && span.name && span.name !== span.op ? (
198199
<DescriptionWrapper>
199200
<FormattedDescription>{span.name}</FormattedDescription>
200201
<CopyToClipboardButton

static/app/views/performance/newTraceDetails/traceRow/traceSpanRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ export function TraceSpanRow(
110110
)}
111111
{shouldUseOTelFriendlyUI &&
112112
isEAPSpanNode(props.node) &&
113-
props.node.value.name ? (
113+
props.node.value.name &&
114+
props.node.value.name !== props.node.value.op ? (
114115
<React.Fragment>
115116
<span className="TraceName" title={props.node.value.name}>
116117
{ellipsize(props.node.value.name, 100)}

0 commit comments

Comments
 (0)