Skip to content

Commit

Permalink
Decorate ScyllaDB Reader With Metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Nov 24, 2024
1 parent e59b000 commit 44033f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/spanstore"
storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics"
)

const (
Expand Down Expand Up @@ -153,7 +154,12 @@ func (f *Factory) CreateSpanReader() (spanstore.Reader, error) {
if !ok {
return nil, fmt.Errorf("no %s backend registered for span store", f.SpanReaderType)
}
return factory.CreateSpanReader()
sr, err := factory.CreateSpanReader()
if err != nil {
return nil, err
}
queryMetricsFactory := f.metricsFactory.Namespace(metrics.NSOptions{Name: "query"})
return storageMetrics.NewReadMetricsDecorator(sr, queryMetricsFactory), nil
}

// CreateSpanWriter implements storage.Factory.
Expand Down

0 comments on commit 44033f1

Please sign in to comment.