Package me.dinowernli.grpc.prometheus
Class MonitoringClientInterceptor
- java.lang.Object
-
- me.dinowernli.grpc.prometheus.MonitoringClientInterceptor
-
- All Implemented Interfaces:
ClientInterceptor
public class MonitoringClientInterceptor extends java.lang.Object implements ClientInterceptor
AClientInterceptorwhich sends stats about incoming grpc calls to Prometheus.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MonitoringClientInterceptorcreate(Configuration configuration)<R,S>
ClientCall<R,S>interceptCall(MethodDescriptor<R,S> methodDescriptor, CallOptions callOptions, Channel channel)
-
-
-
Method Detail
-
create
public static MonitoringClientInterceptor create(Configuration configuration)
-
interceptCall
public <R,S> ClientCall<R,S> interceptCall(MethodDescriptor<R,S> methodDescriptor, CallOptions callOptions, Channel channel)
Description copied from interface:ClientInterceptorInterceptClientCallcreation by thenextChannel.Many variations of interception are possible. Complex implementations may return a wrapper around the result of
next.newCall(), whereas a simpler implementation may just modify the header metadata prior to returning the result ofnext.newCall().next.newCall()must not be called under a differentContextother than the currentContext. The outcome of such usage is undefined and may cause memory leak due to unbounded chain ofContexts.- Specified by:
interceptCallin interfaceClientInterceptor- Parameters:
methodDescriptor- the remote method to be called.callOptions- the runtime options to be applied to this call.channel- the channel which is being intercepted.- Returns:
- the call object for the remote operation, never
null.
-
-