Skip to content

Commit

Permalink
Tidy up for PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zalegrala committed Sep 2, 2021
1 parent 0e781c1 commit a119dc2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/tempo-vulture/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ func constructTraceFromEpoch(epoch time.Time) *tempopb.Trace {
// get the parentSpanID to match. In the case of an empty []byte in place
// for the ParentSpanId, we set to nil here to ensure that the final result
// matches the json.Unmarshal value when tempo is queried.
for ib, b := range t.Batches {
for il, l := range b.InstrumentationLibrarySpans {
for is, s := range l.Spans {
for _, b := range t.Batches {
for _, l := range b.InstrumentationLibrarySpans {
for _, s := range l.Spans {
if len(s.GetParentSpanId()) == 0 {
t.Batches[ib].InstrumentationLibrarySpans[il].Spans[is].ParentSpanId = nil
s.ParentSpanId = nil
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions cmd/tempo-vulture/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,11 @@ func TestResponseFixture(t *testing.T) {
}
}

func TestEqualTraces(t *testing.T) {
seed := time.Now()
a := constructTraceFromEpoch(seed)
b := constructTraceFromEpoch(seed)
require.True(t, equalTraces(a, b))
}

func stringPointer(s string) *string { return &s }

0 comments on commit a119dc2

Please sign in to comment.