Skip to content

Commit

Permalink
fix(tempohandler): sort traces before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed May 31, 2024
1 parent a1a5a49 commit 4971482
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/tempohandler/collector.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package tempohandler

import (
"slices"

"github.com/google/uuid"
"go.opentelemetry.io/collector/pdata/ptrace"

Expand Down Expand Up @@ -55,6 +57,9 @@ func (b *metadataCollector) Result() (r []tempoapi.TraceSearchMetadata) {
}
r = append(r, v)
}
slices.SortFunc(r, func(a, b tempoapi.TraceSearchMetadata) int {
return a.StartTimeUnixNano.Compare(b.StartTimeUnixNano)
})
return r
}

Expand Down

0 comments on commit 4971482

Please sign in to comment.