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 <[email protected]>
  • Loading branch information
ekefan committed Jan 16, 2025
1 parent 6772ee9 commit 7e58074
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/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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 7e58074

Please sign in to comment.