Skip to content

Commit

Permalink
Use V2 Factory To Get Dependency Reader
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Dec 6, 2024
1 parent d07eebc commit aa112ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions cmd/all-in-one/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 2 additions & 8 deletions cmd/jaeger/internal/extension/jaegerquery/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,17 @@ 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()
if err != nil {
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)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit aa112ed

Please sign in to comment.