Metrics
This extension integrates spring-boot-starter-actuator
to collect metrics for gRPC client and server.
Dependencies
- Gradle
- Maven
implementation("io.github.danielliu1123:grpc-starter-metrics")
<dependency>
<groupId>io.github.danielliu1123</groupId>
<artifactId>grpc-starter-metrics</artifactId>
</dependency>
Example
Refer to metrics example.
Configurations
If you want to disable the metrics, using the following configuration:
grpc:
metrics:
enabled: false
Only disable the metrics for the client:
grpc:
metrics:
client:
enabled: false
Only disable the metrics for the server:
grpc:
metrics:
server:
enabled: false
The metrics processing is implemented through ClientInterceptor
and ServerInterceptor
.
The order of interceptors can be customized.
The default order is 0.
grpc:
metrics:
client:
order: 0
server:
order: 0