@GrpcGlobalClientInterceptor @Order(value=2500) public class MetricCollectingClientInterceptor extends net.devh.boot.grpc.common.metric.AbstractMetricCollectingInterceptor implements ClientInterceptor
| 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 Counters and Timers. |
| 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) |
@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 Counters and Timers.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 net.devh.boot.grpc.common.metric.AbstractMetricCollectingInterceptorprotected io.micrometer.core.instrument.Counter newResponseCounterFor(MethodDescriptor<?,?> method)
newResponseCounterFor in class net.devh.boot.grpc.common.metric.AbstractMetricCollectingInterceptorprotected Function<Status.Code,io.micrometer.core.instrument.Timer> newTimerFunction(MethodDescriptor<?,?> method)
newTimerFunction in class net.devh.boot.grpc.common.metric.AbstractMetricCollectingInterceptorpublic <Q,A> ClientCall<Q,A> interceptCall(MethodDescriptor<Q,A> methodDescriptor, CallOptions callOptions, Channel channel)
interceptCall in interface ClientInterceptor