@GrpcGlobalClientInterceptor @Order(value=2500) public class MetricCollectingClientInterceptor extends AbstractMetricCollectingInterceptor implements ClientInterceptor
AbstractMetricCollectingInterceptor.MetricSet
counterCustomizer, eagerInitializedCodes, registry, timerCustomizer
Constructor and Description |
---|
MetricCollectingClientInterceptor(io.micrometer.core.instrument.MeterRegistry registry)
Creates a new gRPC client interceptor that will collect metrics into the given
MeterRegistry . |
MetricCollectingClientInterceptor(io.micrometer.core.instrument.MeterRegistry registry,
UnaryOperator<io.micrometer.core.instrument.Counter.Builder> counterCustomizer,
UnaryOperator<io.micrometer.core.instrument.Timer.Builder> timerCustomizer,
Status.Code... eagerInitializedCodes)
Creates a new gRPC client interceptor that will collect metrics into the given
MeterRegistry and uses the
given customizer to configure the Counter s and Timer s. |
Modifier and Type | Method and Description |
---|---|
<Q,A> ClientCall<Q,A> |
interceptCall(MethodDescriptor<Q,A> methodDescriptor,
CallOptions callOptions,
Channel channel) |
protected io.micrometer.core.instrument.Counter |
newRequestCounterFor(MethodDescriptor<?,?> method) |
protected io.micrometer.core.instrument.Counter |
newResponseCounterFor(MethodDescriptor<?,?> method) |
protected Function<Status.Code,io.micrometer.core.instrument.Timer> |
newTimerFunction(MethodDescriptor<?,?> method) |
asTimerFunction, metricsFor, newMetricsFor, preregisterMethod, preregisterService
@Autowired public MetricCollectingClientInterceptor(io.micrometer.core.instrument.MeterRegistry registry)
MeterRegistry
.registry
- The registry to use.public MetricCollectingClientInterceptor(io.micrometer.core.instrument.MeterRegistry registry, UnaryOperator<io.micrometer.core.instrument.Counter.Builder> counterCustomizer, UnaryOperator<io.micrometer.core.instrument.Timer.Builder> timerCustomizer, Status.Code... eagerInitializedCodes)
MeterRegistry
and uses the
given customizer to configure the Counter
s and Timer
s.registry
- The registry to use.counterCustomizer
- The unary function that can be used to customize the created counters.timerCustomizer
- The unary function that can be used to customize the created timers.eagerInitializedCodes
- The status codes that should be eager initialized.protected io.micrometer.core.instrument.Counter newRequestCounterFor(MethodDescriptor<?,?> method)
newRequestCounterFor
in class AbstractMetricCollectingInterceptor
protected io.micrometer.core.instrument.Counter newResponseCounterFor(MethodDescriptor<?,?> method)
newResponseCounterFor
in class AbstractMetricCollectingInterceptor
protected Function<Status.Code,io.micrometer.core.instrument.Timer> newTimerFunction(MethodDescriptor<?,?> method)
newTimerFunction
in class AbstractMetricCollectingInterceptor
public <Q,A> ClientCall<Q,A> interceptCall(MethodDescriptor<Q,A> methodDescriptor, CallOptions callOptions, Channel channel)
interceptCall
in interface ClientInterceptor