-
Notifications
You must be signed in to change notification settings - Fork 81
Add OpenTelemetry tracing instrumentation support #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Cory Snider <[email protected]>
Make the remote peer's address available to client and server interceptors, and to server handlers, by annoting the respective request contexts with peer.Peer values. The same peer.Peer value is reused for all requests on a connection to reduce GC pressure. This does run the risk, however, of the value getting mutated in one request affecting the value read back in other requests on the same connection. Signed-off-by: Cory Snider <[email protected]>
Provide client and server interceptors which instrument RPC requests with OpenTracing telemetry spans, based on the gRPC tracing module go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/[email protected] Signed-off-by: Cory Snider <[email protected]>
The client sets the metadata on the request before calling the interceptor, and the method to set the metadata on the request is unexported, so interceptors cannot alter the request's metadata (other than by directly manipulating the request's |
@corhere are you still working on this PR? I think this is useful to have and we have had a few requests to add ttrpc tracing in containerd. |
if p, ok := message.(proto.Message); ok { | ||
span.AddEvent("message", trace.WithAttributes( | ||
attribute.KeyValue(m), | ||
semconv.MessageUncompressedSizeKey.Int(proto.Size(p)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This led to performance issue for otel grpc as the otlpreceiver consume lots of cpu for proto.Size. It has been removed since open-telemetry/opentelemetry-go-contrib#3168
@swagatbora90 no, I am not working on this PR. You are welcome to take it over. |
Provide client and server interceptors which instrument RPC requests with OpenTracing telemetry spans, based on the gRPC tracing module
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/[email protected]
.