Module: ApolloFederation::Tracing

Defined in:
lib/apollo-federation/tracing.rb,
lib/apollo-federation/tracing/proto.rb,
lib/apollo-federation/tracing/tracer.rb,
lib/apollo-federation/tracing/node_map.rb

Defined Under Namespace

Modules: Tracer Classes: NodeMap

Constant Summary collapse

HEADER_NAME =
'HTTP_APOLLO_FEDERATION_INCLUDE_TRACE'
KEY =
:ftv1
DEBUG_KEY =
"#{KEY}_debug".to_sym
Trace =
::Mdg::Engine::Proto::Trace
Node =
::Mdg::Engine::Proto::Trace::Node
Location =
::Mdg::Engine::Proto::Trace::Location
Error =
::Mdg::Engine::Proto::Trace::Error

Class Method Summary collapse

Class Method Details

.attach_trace_to_result(_result) ⇒ Object

Deprecated.

There is no need to call this method. Traces are added to the result automatically



20
21
22
23
# File 'lib/apollo-federation/tracing.rb', line 20

def attach_trace_to_result(_result)
  warn '[DEPRECATION] `attach_trace_to_result` is deprecated. There is no need to call it, as '\
    'traces are added to the result automatically'
end

.should_add_traces(headers) ⇒ Object



15
16
17
# File 'lib/apollo-federation/tracing.rb', line 15

def should_add_traces(headers)
  headers && headers[HEADER_NAME] == KEY.to_s
end

.use(schema) ⇒ Object



11
12
13
# File 'lib/apollo-federation/tracing.rb', line 11

def use(schema)
  schema.tracer ApolloFederation::Tracing::Tracer
end