From aa112eda863032b5c00b467c8045fd552c7caef2 Mon Sep 17 00:00:00 2001 From: Mahad Zaryab Date: Fri, 6 Dec 2024 17:27:44 -0500 Subject: [PATCH] Use V2 Factory To Get Dependency Reader Signed-off-by: Mahad Zaryab --- cmd/all-in-one/main.go | 6 +++--- cmd/jaeger/internal/extension/jaegerquery/server.go | 10 ++-------- cmd/query/main.go | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index 9b7b89dfba1..2e46e6ad7e8 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -38,7 +38,7 @@ import ( ss "github.com/jaegertracing/jaeger/plugin/sampling/strategyprovider" "github.com/jaegertracing/jaeger/plugin/storage" "github.com/jaegertracing/jaeger/ports" - "github.com/jaegertracing/jaeger/storage/dependencystore" + "github.com/jaegertracing/jaeger/storage_v2/depstore" "github.com/jaegertracing/jaeger/storage_v2/factoryadapter" "github.com/jaegertracing/jaeger/storage_v2/tracestore" ) @@ -114,7 +114,7 @@ by default uses only in-memory database.`, if err != nil { logger.Fatal("Failed to create span writer", zap.Error(err)) } - dependencyReader, err := storageFactory.CreateDependencyReader() + dependencyReader, err := v2Factory.CreateDependencyReader() if err != nil { logger.Fatal("Failed to create dependency reader", zap.Error(err)) } @@ -218,7 +218,7 @@ func startQuery( qOpts *queryApp.QueryOptions, queryOpts *querysvc.QueryServiceOptions, traceReader tracestore.Reader, - depReader dependencystore.Reader, + depReader depstore.Reader, metricsQueryService querysvc.MetricsQueryService, tm *tenancy.Manager, telset telemetry.Settings, diff --git a/cmd/jaeger/internal/extension/jaegerquery/server.go b/cmd/jaeger/internal/extension/jaegerquery/server.go index 29f836e9c89..65c34488c22 100644 --- a/cmd/jaeger/internal/extension/jaegerquery/server.go +++ b/cmd/jaeger/internal/extension/jaegerquery/server.go @@ -71,15 +71,9 @@ func (s *server) Start(ctx context.Context, host component.Host) error { telset.Metrics = telset.Metrics. Namespace(metrics.NSOptions{Name: "jaeger"}). Namespace(metrics.NSOptions{Name: "query"}) - - // TODO currently v1 is still needed because of dependency storage - v1Factory, err := jaegerstorage.GetStorageFactory(s.config.Storage.TracesPrimary, host) - if err != nil { - return fmt.Errorf("cannot find v1 factory for primary storage %s: %w", s.config.Storage.TracesPrimary, err) - } f, err := jaegerstorage.GetStorageFactoryV2(s.config.Storage.TracesPrimary, host) if err != nil { - return fmt.Errorf("cannot find v2 factory for primary storage %s: %w", s.config.Storage.TracesPrimary, err) + return fmt.Errorf("cannot find factory for primary storage %s: %w", s.config.Storage.TracesPrimary, err) } traceReader, err := f.CreateTraceReader() @@ -87,7 +81,7 @@ func (s *server) Start(ctx context.Context, host component.Host) error { return fmt.Errorf("cannot create trace reader: %w", err) } - depReader, err := v1Factory.CreateDependencyReader() + depReader, err := f.CreateDependencyReader() if err != nil { return fmt.Errorf("cannot create dependencies reader: %w", err) } diff --git a/cmd/query/main.go b/cmd/query/main.go index 5d32b5db10f..9e3e6dce93b 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -96,7 +96,7 @@ func main() { if err != nil { logger.Fatal("Failed to create trace reader", zap.Error(err)) } - dependencyReader, err := storageFactory.CreateDependencyReader() + dependencyReader, err := v2Factory.CreateDependencyReader() if err != nil { logger.Fatal("Failed to create dependency reader", zap.Error(err)) }