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) (#1074)

Signed-off-by: Gary Brown <[email protected]>
  • Loading branch information
objectiser authored and black-adder committed Sep 20, 2018
1 parent 79d10f2 commit e8e5962
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 e8e5962

Please sign in to comment.