﻿---
title: Set up gRPC instrumentation
description: How to enable Elastic APM .NET Agent automatic instrumentation of gRPC client and server-side calls.
url: https://www.elastic.co/elastic/docs-builder/docs/3410/reference/apm/agents/dotnet/setup-grpc
products:
  - APM .NET Agent
  - APM Agent
applies_to:
  - Serverless Observability projects: Generally available
  - Elastic Stack: Generally available
  - Application Performance Monitoring Agent for .NET: Generally available
---

# Set up gRPC instrumentation
## Supported versions


| Package           | Supported versions |
|-------------------|--------------------|
| `Grpc.Net.Client` | ≥2.23.2 <3.0.0     |

gRPC server-side instrumentation is built in to ASP.NET Core (≥8.0.0 ≤10.0.x) and does not require an additional package.
For the full compatibility matrix including supported installation methods, refer to [RPC frameworks](/elastic/docs-builder/docs/3410/reference/apm/agents/dotnet/supported-technologies#supported-rpc-frameworks).

## Quick start

This page assumes the core agent is already set up. If not, see [Set up the APM .NET Agent](https://www.elastic.co/elastic/docs-builder/docs/3410/reference/apm/agents/dotnet/set-up-apm-net-agent) first.

### Server-side

Server-side gRPC instrumentation is automatically included when using the [ASP.NET Core setup](https://www.elastic.co/elastic/docs-builder/docs/3410/reference/apm/agents/dotnet/setup-asp-net-core). No additional package is required.

### Client-side

Add the [`Elastic.Apm.GrpcClient`](https://www.nuget.org/packages/Elastic.Apm.GrpcClient) NuGet package to your project:
```sh
dotnet add package Elastic.Apm.GrpcClient
```

Pass `GrpcClientDiagnosticListener` to the `AddElasticApm` method in case of ASP.NET Core:
```csharp
using Elastic.Apm.GrpcClient;

app.Services.AddElasticApm(new GrpcClientDiagnosticListener());
```

or passing `GrpcClientDiagnosticSubscriber` to the `Subscribe` method
```csharp
using Elastic.Apm;
using Elastic.Apm.GrpcClient;

Agent.Subscribe(new GrpcClientDiagnosticSubscriber());
```

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