diff --git a/CHANGELOG.md b/CHANGELOG.md index acbc7756683..05432ef42c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * [BUGFIX] Updated `golang.org/x/net` dependency to fix CVE-2022-27664. #5008 * [BUGFIX] Fix panic when otel and xray tracing is enabled. #5044 * [BUGFIX] Fixed no compact block got grouped in shuffle sharding grouper. #5055 +* [BUGFIX] Tracing: Fix missing object storage span instrumentation. #5074 ## 1.14.0 2022-12-02 diff --git a/pkg/cortex/tracing.go b/pkg/cortex/tracing.go index daa05e154d3..1d0adb9f3b6 100644 --- a/pkg/cortex/tracing.go +++ b/pkg/cortex/tracing.go @@ -4,6 +4,7 @@ import ( "context" "github.com/opentracing/opentracing-go" + objstoretracing "github.com/thanos-io/objstore/tracing" "github.com/thanos-io/thanos/pkg/tracing" "google.golang.org/grpc" ) @@ -11,14 +12,16 @@ import ( // ThanosTracerUnaryInterceptor injects the opentracing global tracer into the context // in order to get it picked up by Thanos components. func ThanosTracerUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + ctx = objstoretracing.ContextWithTracer(ctx, opentracing.GlobalTracer()) return handler(tracing.ContextWithTracer(ctx, opentracing.GlobalTracer()), req) } // ThanosTracerStreamInterceptor injects the opentracing global tracer into the context // in order to get it picked up by Thanos components. func ThanosTracerStreamInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + ctx := objstoretracing.ContextWithTracer(ss.Context(), opentracing.GlobalTracer()) return handler(srv, wrappedServerStream{ - ctx: tracing.ContextWithTracer(ss.Context(), opentracing.GlobalTracer()), + ctx: tracing.ContextWithTracer(ctx, opentracing.GlobalTracer()), ServerStream: ss, }) }