# gRPC

<!-- llms-txt-link: /llms.txt -->

> OpenTelemetry Java agent instrumentation

This instrumentation enables RPC client and RPC server spans and metrics for gRPC.

- **Name**: `grpc-1.6`
- **Scope**: `io.opentelemetry.grpc-1.6`
- **Target versions**: `io.grpc:grpc-core:[1.6.0,)`
- **Library**: https://github.com/grpc/grpc-java

## Telemetry

- **Metrics**: `rpc.client.duration`, `rpc.client.request.size`, `rpc.client.response.size`, `rpc.server.duration`, `rpc.server.request.size`, `rpc.server.response.size`, `rpc.client.call.duration`, `rpc.server.call.duration`
- **Span attributes**: `rpc.grpc.status_code`, `rpc.method`, `rpc.service`, `rpc.system`, `server.address`, `server.port`, `network.peer.address`, `network.peer.port`, `network.type`, `grpc.received.message_count`, `grpc.sent.message_count`, `error.type`, `rpc.response.status_code`, `rpc.system.name`

## Configuration

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `otel.instrumentation.grpc.capture-metadata.client.request` | list |  | A comma-separated list of request metadata keys. gRPC client instrumentation will capture metadata values corresponding to configured keys as span attributes. |
| `otel.instrumentation.grpc.capture-metadata.server.request` | list |  | A comma-separated list of request metadata keys. gRPC server instrumentation will capture metadata values corresponding to configured keys as span attributes. |
| `otel.instrumentation.grpc.emit-message-events` | boolean | true | Determines whether to emit a span event for each individual message received and sent. |
| `otel.instrumentation.grpc.experimental-span-attributes` | boolean | false | Enable the capture of experimental span attributes `grpc.received.message_count`, `grpc.sent.message_count` and `grpc.canceled`. |

## Data

- **JSON**: [/data/javaagent/instrumentations/grpc-1.6/grpc-1.6-2b51215c8085.json](/data/javaagent/instrumentations/grpc-1.6/grpc-1.6-2b51215c8085.json)
- **Explore**: [/java-agent/instrumentation/grpc-1.6](/java-agent/instrumentation/grpc-1.6)
