Class GrpcServerMetricAutoConfiguration
java.lang.Object
net.devh.boot.grpc.server.autoconfigure.GrpcServerMetricAutoConfiguration
@Configuration(proxyBeanMethods=false)
@AutoConfigureAfter(org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration.class)
@AutoConfigureBefore(GrpcServerAutoConfiguration.class)
@ConditionalOnBean(io.micrometer.core.instrument.MeterRegistry.class)
@ConditionalOnClass(io.micrometer.core.instrument.binder.grpc.MetricCollectingServerInterceptor.class)
public class GrpcServerMetricAutoConfiguration
extends Object
Auto configuration class for Spring-Boot. This allows zero config server metrics for gRPC services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectMethodNamesForService
(ServiceDescriptor serviceDescriptor) Gets all method names from the given service descriptor.metricCollectingServerInterceptor
(MeterRegistry registry, Collection<BindableService> services) streamTracerFactoryConfigurer
(MeterRegistry registry)
-
Constructor Details
-
GrpcServerMetricAutoConfiguration
public GrpcServerMetricAutoConfiguration()
-
-
Method Details
-
metricCollectingServerInterceptor
@GrpcGlobalServerInterceptor @Order(2500) @ConditionalOnMissingBean public MetricCollectingServerInterceptor metricCollectingServerInterceptor(MeterRegistry registry, Collection<BindableService> services) -
streamTracerFactoryConfigurer
@ConditionalOnProperty(prefix="grpc", name="metricsA66Enabled", matchIfMissing=true) @Bean public GrpcServerConfigurer streamTracerFactoryConfigurer(MeterRegistry registry) -
collectMethodNamesForService
Gets all method names from the given service descriptor.- Parameters:
serviceDescriptor
- The service descriptor to get the names from.- Returns:
- The newly created and sorted list of the method names.
-