Skip to content

Commit

Permalink
Make the metrics produced by jaeger query scoped to the query compone…
Browse files Browse the repository at this point in the history
…nt, and generated for all span readers (not just ES)

Signed-off-by: Gary Brown <gary@brownuk.com>
  • Loading branch information
objectiser committed Sep 20, 2018
1 parent 4bbf7c2 commit d3f360c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/all-in-one/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import (
"github.com/jaegertracing/jaeger/plugin/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/spanstore"
storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics"
jc "github.com/jaegertracing/jaeger/thrift-gen/jaeger"
sc "github.com/jaegertracing/jaeger/thrift-gen/sampling"
zc "github.com/jaegertracing/jaeger/thrift-gen/zipkincore"
Expand Down Expand Up @@ -286,6 +287,8 @@ func startQuery(
}
opentracing.SetGlobalTracer(tracer)

spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, baseFactory.Namespace("query", nil))

apiHandler := queryApp.NewAPIHandler(
spanReader,
depReader,
Expand Down
2 changes: 2 additions & 0 deletions cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/jaegertracing/jaeger/pkg/version"
"github.com/jaegertracing/jaeger/plugin/storage"
istorage "github.com/jaegertracing/jaeger/storage"
storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics"
)

func main() {
Expand Down Expand Up @@ -107,6 +108,7 @@ func main() {
if err != nil {
logger.Fatal("Failed to create span reader", zap.Error(err))
}
spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, baseFactory.Namespace("query", nil))
dependencyReader, err := storageFactory.CreateDependencyReader()
if err != nil {
logger.Fatal("Failed to create dependency reader", zap.Error(err))
Expand Down
3 changes: 1 addition & 2 deletions plugin/storage/es/spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/jaegertracing/jaeger/pkg/es"
"github.com/jaegertracing/jaeger/plugin/storage/es/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics"
)

const (
Expand Down Expand Up @@ -109,7 +108,7 @@ type SpanReaderParams struct {

// NewSpanReader returns a new SpanReader with a metrics.
func NewSpanReader(p SpanReaderParams) spanstore.Reader {
return storageMetrics.NewReadMetricsDecorator(newSpanReader(p), p.MetricsFactory)
return newSpanReader(p)
}

func newSpanReader(p SpanReaderParams) *SpanReader {
Expand Down

0 comments on commit d3f360c

Please sign in to comment.