Skip to content

Commit

Permalink
refactor to use archive trace reader-writer
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Emonueje Ebenezer <eebenezer949@gmail.com>
  • Loading branch information
ekefan committed Jan 26, 2025
1 parent 6ab854c commit 71b5e38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 5 additions & 6 deletions plugin/storage/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,11 @@ func (s *StorageIntegration) testArchiveTrace(t *testing.T) {
var actual *model.Trace
found := s.waitForCondition(t, func(_ *testing.T) bool {
var err error
// iterTraces := s.ArchiveTraceReader.GetTraces(context.Background(), tracestore.GetTraceParams{TraceID: tID.ToOTELTraceID()})
// traces, err := v1adapter.V1TracesFromSeq2(iterTraces)
// if len(traces) > 0 {
// actual = traces[0]
// }
actual, err = s.ArchiveTraceReader.(*v1adapter.TraceReader).GetArchiveTraces(context.Background(), tracestore.GetTraceParams{TraceID: tID.ToOTELTraceID()})
iterTraces := s.ArchiveTraceReader.GetTraces(context.Background(), tracestore.GetTraceParams{TraceID: v1adapter.FromV1TraceID(tID)})
traces, err := v1adapter.V1TracesFromSeq2(iterTraces)
if len(traces) > 0 {
actual = traces[0]
}
return err == nil && len(actual.Spans) >= len(expected.Spans)
})
require.True(t, found)
Expand Down
5 changes: 0 additions & 5 deletions storage_v2/v1adapter/tracereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ func (tr *TraceReader) GetTraces(
}
}

func (tr *TraceReader) GetArchiveTraces(ctx context.Context, traceID tracestore.GetTraceParams) (*model.Trace, error) {
tID := model.TraceIDFromOTEL(traceID.TraceID)
return tr.spanReader.GetTrace(ctx, spanstore.GetTraceParameters{TraceID: tID})
}

func (tr *TraceReader) GetServices(ctx context.Context) ([]string, error) {
return tr.spanReader.GetServices(ctx)
}
Expand Down

0 comments on commit 71b5e38

Please sign in to comment.