Class: Labkit::Tracing::GRPCInterceptor

Inherits:
GRPC::ClientInterceptor
  • Object
show all
Includes:
Common, Singleton
Defined in:
lib/labkit/tracing/grpc_interceptor.rb

Overview

GRPCInterceptor is a client-side GRPC interceptor for instrumenting GRPC calls with distributed tracing

Instance Method Summary collapse

Methods included from Common

#in_tracing_span, #kv_tags_for_exception, #log_exception_on_span, #postnotify_span, #tracer

Instance Method Details

#bidi_streamer(requests:, call:, method:, metadata:) ⇒ Object



27
28
29
# File 'lib/labkit/tracing/grpc_interceptor.rb', line 27

def bidi_streamer(requests:, call:, method:, metadata:)
  wrap_with_tracing(method, "bidi_stream", ) { yield }
end

#client_streamer(requests:, call:, method:, metadata:) ⇒ Object



19
20
21
# File 'lib/labkit/tracing/grpc_interceptor.rb', line 19

def client_streamer(requests:, call:, method:, metadata:)
  wrap_with_tracing(method, "client_stream", ) { yield }
end

#request_response(request:, call:, method:, metadata:) ⇒ Object



15
16
17
# File 'lib/labkit/tracing/grpc_interceptor.rb', line 15

def request_response(request:, call:, method:, metadata:)
  wrap_with_tracing(method, "unary", ) { yield }
end

#server_streamer(request:, call:, method:, metadata:) ⇒ Object



23
24
25
# File 'lib/labkit/tracing/grpc_interceptor.rb', line 23

def server_streamer(request:, call:, method:, metadata:)
  wrap_with_tracing(method, "server_stream", ) { yield }
end