opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

uprobe_ClientConn_Invoke is not writing Traceparent/grpc-trace-bin to Outgoing Metadata

Open clavinjune opened this issue 1 year ago • 3 comments

I wonder why we don't write an outgoing metadata, instead we inject the traceID and spanID to request? I found that the traceparent / grpc-trace-bin data is not injected to the metadata.

Anyone able to explain me regarding this? Thank you 🙇

https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/7218a9d1d405e9f27949c4502c53b7013ed108ca/internal/pkg/instrumentation/bpf/google.golang.org/grpc/client/bpf/probe.bpf.c#L67-L126

clavinjune avatar Jan 29 '24 10:01 clavinjune

What are the advantages of injecting to the metadata over the current approach ?

RonFed avatar Jan 29 '24 16:01 RonFed

What are the advantages of injecting to the metadata over the current approach ?

I'm currently using istio to generate traceparent header, I found that since the traceparent is not passed to metadata, istio will try to generate one on every gRPC call, I have tried to reproduce it on my local and it creates two different traceID

meanwhile if I manually inject the the Traceparent to the outgoing metadata, istio detected it so it won't create a new traceID

is this expected @RonFed ?

clavinjune avatar Jan 30 '24 02:01 clavinjune

it's weird, whenever I create a connection using grpc.Dial, I have to manually inject the Traceparent to the outgoing metdadata, meanwhile if I create the connection using grpc.DialContext(context.Background(), ...), I don't need to manually inject it. Is this expected? If yes, could you please help to locate the docs/code regarding this? thank you :bow:

clavinjune avatar Jan 31 '24 09:01 clavinjune