Module: Labkit::Correlation::GRPC::GRPCCommon

Included in:
ClientInterceptor, ServerInterceptor, Logging::GRPC::ServerInterceptor, Tracing::GRPC::ServerInterceptor
Defined in:
lib/labkit/correlation/grpc/grpc_common.rb

Overview

This module is shared between the client and server interceptor middlewares. It is not part of the public API

Constant Summary collapse

CORRELATION_METADATA_KEY =
"x-gitlab-correlation-id"

Instance Method Summary collapse

Instance Method Details

#rpc_split(method) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/labkit/correlation/grpc/grpc_common.rb', line 11

def rpc_split(method)
  owner = method.owner
  method_name, = owner.rpc_descs.find do |k, _|
    ::GRPC::GenericService.underscore(k.to_s) == method.name.to_s
  end
  method_name ||= "(unknown)"

  [owner.service_name, method_name]
end