Class: GraphQL::Tracing::ScoutTracing

Inherits:
PlatformTracing show all
Defined in:
lib/graphql/tracing/scout_tracing.rb

Constant Summary collapse

INSTRUMENT_OPTS =
{ scope: true }

Instance Method Summary collapse

Methods inherited from PlatformTracing

#instrument, #trace, #trace_field, use

Constructor Details

#initialize(options = {}) ⇒ ScoutTracing

Returns a new instance of ScoutTracing


19
20
21
22
# File 'lib/graphql/tracing/scout_tracing.rb', line 19

def initialize(options = {})
  self.class.include ScoutApm::Tracer
  super(options)
end

Instance Method Details

#platform_field_key(type, field) ⇒ Object


30
31
32
# File 'lib/graphql/tracing/scout_tracing.rb', line 30

def platform_field_key(type, field)
  "#{type.name}.#{field.name}"
end

#platform_trace(platform_key, key, data) ⇒ Object


24
25
26
27
28
# File 'lib/graphql/tracing/scout_tracing.rb', line 24

def platform_trace(platform_key, key, data)
  self.class.instrument("GraphQL", platform_key, INSTRUMENT_OPTS) do
    yield
  end
end