Class GrpcClientMetricAutoConfiguration
java.lang.Object
net.devh.boot.grpc.client.autoconfigure.GrpcClientMetricAutoConfiguration
@Configuration(proxyBeanMethods=false)
@AutoConfigureAfter(org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration.class)
@AutoConfigureBefore(GrpcClientAutoConfiguration.class)
@ConditionalOnBean(io.micrometer.core.instrument.MeterRegistry.class)
@ConditionalOnClass(io.micrometer.core.instrument.binder.grpc.MetricCollectingClientInterceptor.class)
public class GrpcClientMetricAutoConfiguration
extends Object
Auto configuration class for Spring-Boot. This allows zero config client metrics for gRPC services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates aClientInterceptor
that collects metrics about incoming and outgoing requests and responses.metricsClientInterceptor
(MeterRegistry registry) Creates aClientInterceptor
that collects metrics about client attempts and client calls.
-
Constructor Details
-
GrpcClientMetricAutoConfiguration
public GrpcClientMetricAutoConfiguration()
-
-
Method Details
-
metricCollectingClientInterceptor
@GrpcGlobalClientInterceptor @Order(2500) @ConditionalOnMissingBean public MetricCollectingClientInterceptor metricCollectingClientInterceptor(MeterRegistry registry) Creates aClientInterceptor
that collects metrics about incoming and outgoing requests and responses.- Parameters:
registry
- The registry used to create the metrics.- Returns:
- The newly created MetricCollectingClientInterceptor bean.
-
metricsClientInterceptor
@ConditionalOnProperty(prefix="grpc", name="metricsA66Enabled", matchIfMissing=true) @GrpcGlobalClientInterceptor @Order(2500) @ConditionalOnMissingBean public MetricsClientInterceptor metricsClientInterceptor(MeterRegistry registry) Creates aClientInterceptor
that collects metrics about client attempts and client calls.- Parameters:
registry
- The registry used to create the metrics.- Returns:
- The newly created MetricsClientInterceptor bean.
-