Class: ElasticAPM::GRPC::ClientInterceptor Private

Inherits:
GRPC::ClientInterceptor
  • Object
show all
Defined in:
lib/elastic_apm/grpc.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

TYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'external'
SUBTYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'grpc'

Instance Method Summary collapse

Instance Method Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:disable Lint/UnusedMethodArgument, Style/ExplicitBlockArgument



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/elastic_apm/grpc.rb', line 29

def request_response(request:, call:, method:, metadata:)
  return yield unless (transaction = ElasticAPM.current_transaction)
  if (trace_context = transaction.trace_context)
    trace_context.apply_headers { |k, v| [k.downcase] = v }
  end

  ElasticAPM.with_span(
    method, TYPE,
    subtype: SUBTYPE,
    context: span_context(call)
  ) do
    yield
  end
end