Skip to content

Commit

Permalink
Get archive traces for es
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 17, 2025
1 parent 01b1a05 commit 7486084
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugin/storage/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ 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]
}
// 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()})
return err == nil && len(actual.Spans) >= len(expected.Spans)
})
require.True(t, found)
Expand Down
5 changes: 5 additions & 0 deletions storage_v2/v1adapter/tracereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ 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 7486084

Please sign in to comment.