Package me.dinowernli.grpc.prometheus
Class MonitoringServerInterceptor
- java.lang.Object
-
- me.dinowernli.grpc.prometheus.MonitoringServerInterceptor
-
- All Implemented Interfaces:
ServerInterceptor
public class MonitoringServerInterceptor extends java.lang.Object implements ServerInterceptor
AServerInterceptorwhich sends stats about incoming grpc calls to Prometheus.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MonitoringServerInterceptorcreate(Configuration configuration)<R,S>
ServerCall.Listener<R>interceptCall(ServerCall<R,S> call, Metadata requestMetadata, ServerCallHandler<R,S> next)
-
-
-
Method Detail
-
create
public static MonitoringServerInterceptor create(Configuration configuration)
-
interceptCall
public <R,S> ServerCall.Listener<R> interceptCall(ServerCall<R,S> call, Metadata requestMetadata, ServerCallHandler<R,S> next)
Description copied from interface:ServerInterceptorInterceptServerCalldispatch by thenextServerCallHandler. General semantics ofServerCallHandler.startCall(io.grpc.ServerCall<RequestT, ResponseT>, io.grpc.Metadata)apply and the returnedServerCall.Listenermust not benull.If the implementation throws an exception,
callwill be closed with an error. Implementations must not throw an exception if they started processing that may usecallon another thread.- Specified by:
interceptCallin interfaceServerInterceptor- Parameters:
call- object to receive response messagesrequestMetadata- which can contain extra call metadata fromClientCall.start(io.grpc.ClientCall.Listener<RespT>, io.grpc.Metadata), e.g. authentication credentials.next- next processor in the interceptor chain- Returns:
- listener for processing incoming messages for
call, nevernull.
-
-