Commit 9b90c2aa authored by Evan Kirkiles's avatar Evan Kirkiles Committed by devjiwonchoi

Make sort order deterministic

parent b0ee0bb2
...@@ -1230,10 +1230,17 @@ async function expectTrace(collector: Collector, match: SpanMatch[]) { ...@@ -1230,10 +1230,17 @@ async function expectTrace(collector: Collector, match: SpanMatch[]) {
if (nameDiff !== 0) { if (nameDiff !== 0) {
return nameDiff return nameDiff
} }
return ( const segmentDiff =
(a.attributes?.['next.segment'] ?? '').localeCompare( (a.attributes?.['next.segment'] ?? '').localeCompare(
b.attributes?.['next.segment'] ?? '' b.attributes?.['next.segment'] ?? ''
) ?? 0 ) ?? 0
if (segmentDiff !== 0) {
return segmentDiff
}
return (
(a.attributes?.['next.route'] ?? '').localeCompare(
b.attributes?.['next.route'] ?? ''
) ?? 0
) )
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment