This is a cache of https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-grpc.html. It is a snapshot of the page at 2024-10-09T01:04:28.872+0000.
gRPC | APM .NET Agent Reference [1.x] | Elastic

gRPC

edit

Quick start

edit

Automatic instrumentation for gRPC can be enabled for both client-side and server-side gRPC calls.

Automatic instrumentation for ASP.NET Core server-side is built in to NuGet package

Automatic instrumentation can be enabled for the client-side by referencing Elastic.Apm.GrpcClient package and passing GrpcClientDiagnosticListener to the UseElasticApm method in case of ASP.NET Core

app.UseElasticApm(Configuration, new GrpcClientDiagnosticListener()); 

Configuration is the IConfiguration instance passed to your Startup type

or passing GrpcClientDiagnosticSubscriber to the Subscribe method

Agent.Subscribe(new GrpcClientDiagnosticSubscriber());

Diagnostic events from Grpc.Net.Client are captured as spans.