Opentelemetry-dotnet: Support gRPC client integration

Created on 3 Jun 2019  路  4Comments  路  Source: open-telemetry/opentelemetry-dotnet

Are there plans to support tracking outgoing gRPC calls (maybe using interceptor)? Will https://github.com/grpc/grpc-dotnet help with this scenario once it is ready?

areainstrumentation

Most helpful comment

I think that would be solved by this: https://github.com/open-telemetry/opentelemetry-dotnet/pull/687, based on what they wrote, they will create one span for grpc and make a child for httpclient (still didn't finish the whole thread....)

All 4 comments

So I've been experimenting with grpc-dotnet and OpenTelemetrySDK.

Because the grpc-dotnet server is hosted on ASP.NET Core and the gRPC client uses HttpClient we get a lot of tracing for free.

image

image

Source: https://github.com/JamesNK/grpc-dotnet/commit/9831bfb2d7a9b56be3c2c9e4361140b75790e926

The second screenshot shows the HTTP status code, but in gRPC it will always be 200. The gRPC status is sent as a trailer: grpc-status

I think what is needed here is a way to extend the existing ASP.NET Core and HttpClient integration and inject logic to look for that header and other gRPC specific headers, then add them as metadata to the trace.

Basically we want to enrich the existing traces, not add new ones.

Our tracing issue: https://github.com/grpc/grpc-dotnet/issues/318

I think, at least with the current versions, there need to be new traces.

I'm seeing if I have an active span and then make a GRPC call, the GRPC code begins an activity before it calls HttpClient, which begins an activity before making the HTTP call. OpenTelemetry is picking up only the activity started by HttpClient and generating a span from it. Because OpenTelemetry does not generate a span from the GRPC activity, the span parent-child link is broken between the original span and the HttpClient span.

The intermediate activity is generated by Grpc.Net.Client and the event name is Grpc.Net.Client.GrpcOut.Start. The object passed along with the event appears to be the same as the one passed along with HttpRequestOut.Start.

I think that would be solved by this: https://github.com/open-telemetry/opentelemetry-dotnet/pull/687, based on what they wrote, they will create one span for grpc and make a child for httpclient (still didn't finish the whole thread....)

@cijothomas , i think we can close this, since the issue #687 was closed as well.

Was this page helpful?
0 / 5 - 0 ratings