From 71b5e387f6399f84a58e81af6b40baf0540a1c1b Mon Sep 17 00:00:00 2001 From: Emmanuel Emonueje Ebenezer Date: Mon, 27 Jan 2025 00:04:22 +0100 Subject: [PATCH] refactor to use archive trace reader-writer Signed-off-by: Emmanuel Emonueje Ebenezer --- plugin/storage/integration/integration.go | 11 +++++------ storage_v2/v1adapter/tracereader.go | 5 ----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/plugin/storage/integration/integration.go b/plugin/storage/integration/integration.go index 99545f2d74d..058838b3b93 100644 --- a/plugin/storage/integration/integration.go +++ b/plugin/storage/integration/integration.go @@ -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) diff --git a/storage_v2/v1adapter/tracereader.go b/storage_v2/v1adapter/tracereader.go index 151d80d75f5..98ff62976ea 100644 --- a/storage_v2/v1adapter/tracereader.go +++ b/storage_v2/v1adapter/tracereader.go @@ -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) }