Skip to content

Commit

Permalink
Move Decorator From Query Extension To Storage Extension
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Nov 29, 2024
1 parent fb0ecae commit d669fac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cmd/jaeger/internal/extension/jaegerquery/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/jaegertracing/jaeger/plugin/metrics/disabled"
"github.com/jaegertracing/jaeger/storage/metricsstore"
"github.com/jaegertracing/jaeger/storage/metricsstore/metricstoremetrics"
"github.com/jaegertracing/jaeger/storage/storagemetrics"
)

var (
Expand Down Expand Up @@ -60,7 +59,6 @@ func (s *server) Start(ctx context.Context, host component.Host) error {
if err != nil {
return fmt.Errorf("cannot find primary storage %s: %w", s.config.Storage.TracesPrimary, err)
}
f = storagemetrics.NewDecoratorFactory(f, baseFactory)

spanReader, err := f.CreateSpanReader()
if err != nil {
Expand Down
11 changes: 10 additions & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
"github.com/jaegertracing/jaeger/plugin/storage/memory"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/storagemetrics"
"github.com/jaegertracing/jaeger/storage_v2/factoryadapter"
"github.com/jaegertracing/jaeger/storage_v2/spanstore"
)
Expand Down Expand Up @@ -150,7 +151,15 @@ func (s *storageExt) Start(_ context.Context, host component.Host) error {
if err != nil {
return fmt.Errorf("failed to initialize storage '%s': %w", storageName, err)
}
s.factories[storageName] = factory
storageMetricsFactory := mf.Namespace(
metrics.NSOptions{
Name: "storage",
Tags: map[string]string{
"kind": storageName,
},
},
)
s.factories[storageName] = storagemetrics.NewDecoratorFactory(factory, storageMetricsFactory)
}

for metricStorageName, cfg := range s.config.MetricBackends {
Expand Down

0 comments on commit d669fac

Please sign in to comment.