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_authorized_key(type) ⇒ Object



34
35
36
# File 'lib/graphql/tracing/scout_tracing.rb', line 34

def platform_authorized_key(type)
  "#{type.graphql_name}.authorized"
end

#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.graphql_name}.#{field.graphql_name}"
end

#platform_resolve_type_key(type) ⇒ Object



38
39
40
# File 'lib/graphql/tracing/scout_tracing.rb', line 38

def platform_resolve_type_key(type)
  "#{type.graphql_name}.resolve_type"
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