Skip to content

Commit ee26341

Browse files
authored
Fix objstore tracing instrumentation (#5074)
* fix objstore tracing instrumentation Signed-off-by: Ben Ye <[email protected]> * add changelog Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Ben Ye <[email protected]>
1 parent f930c7a commit ee26341

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* [BUGFIX] Updated `golang.org/x/net` dependency to fix CVE-2022-27664. #5008
2121
* [BUGFIX] Fix panic when otel and xray tracing is enabled. #5044
2222
* [BUGFIX] Fixed no compact block got grouped in shuffle sharding grouper. #5055
23+
* [BUGFIX] Tracing: Fix missing object storage span instrumentation. #5074
2324

2425
## 1.14.0 2022-12-02
2526

pkg/cortex/tracing.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ import (
44
"context"
55

66
"github.com/opentracing/opentracing-go"
7+
objstoretracing "github.com/thanos-io/objstore/tracing"
78
"github.com/thanos-io/thanos/pkg/tracing"
89
"google.golang.org/grpc"
910
)
1011

1112
// ThanosTracerUnaryInterceptor injects the opentracing global tracer into the context
1213
// in order to get it picked up by Thanos components.
1314
func ThanosTracerUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
15+
ctx = objstoretracing.ContextWithTracer(ctx, opentracing.GlobalTracer())
1416
return handler(tracing.ContextWithTracer(ctx, opentracing.GlobalTracer()), req)
1517
}
1618

1719
// ThanosTracerStreamInterceptor injects the opentracing global tracer into the context
1820
// in order to get it picked up by Thanos components.
1921
func ThanosTracerStreamInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
22+
ctx := objstoretracing.ContextWithTracer(ss.Context(), opentracing.GlobalTracer())
2023
return handler(srv, wrappedServerStream{
21-
ctx: tracing.ContextWithTracer(ss.Context(), opentracing.GlobalTracer()),
24+
ctx: tracing.ContextWithTracer(ctx, opentracing.GlobalTracer()),
2225
ServerStream: ss,
2326
})
2427
}

0 commit comments

Comments
 (0)