diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index 34d86f534ce..89297fdde2e 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -24,6 +24,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "go.opentelemetry.io/otel" _ "go.uber.org/automaxprocs" "go.uber.org/zap" @@ -104,6 +105,7 @@ by default uses only in-memory database.`, if err != nil { logger.Fatal("Failed to initialize tracer", zap.Error(err)) } + otel.SetTracerProvider(tracer.OTEL) storageFactory.InitFromViper(v, logger) if err := storageFactory.Initialize(metricsFactory, logger); err != nil { diff --git a/cmd/query/main.go b/cmd/query/main.go index aadb7915787..0442dcd06a3 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -23,6 +23,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "go.opentelemetry.io/otel" _ "go.uber.org/automaxprocs" "go.uber.org/zap" @@ -76,6 +77,7 @@ func main() { if err != nil { logger.Fatal("Failed to create tracer:", zap.Error(err)) } + otel.SetTracerProvider(jtracer.OTEL) queryOpts, err := new(app.QueryOptions).InitFromViper(v, logger) if err != nil { logger.Fatal("Failed to configure query service", zap.Error(err)) diff --git a/plugin/storage/es/spanstore/reader.go b/plugin/storage/es/spanstore/reader.go index d766b087670..c124d1391cf 100644 --- a/plugin/storage/es/spanstore/reader.go +++ b/plugin/storage/es/spanstore/reader.go @@ -331,7 +331,7 @@ func bucketToStringArray(buckets []*elastic.AggregationBucketKeyItem) ([]string, // FindTraces retrieves traces that match the traceQuery func (s *SpanReader) FindTraces(ctx context.Context, traceQuery *spanstore.TraceQueryParameters) ([]*model.Trace, error) { - ctx, span := s.tracer.Start(ctx, "GetOperations") + ctx, span := s.tracer.Start(ctx, "FindTraces") defer span.End() uniqueTraceIDs, err := s.FindTraceIDs(ctx, traceQuery)