Module: GraphQL::Tracing::PrometheusTrace

Includes:
PlatformTrace
Defined in:
lib/graphql/tracing/prometheus_trace.rb,
lib/graphql/tracing/prometheus_trace/graphql_collector.rb

Defined Under Namespace

Classes: GraphQLCollector

Instance Method Summary collapse

Instance Method Details

#initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/graphql/tracing/prometheus_trace.rb', line 8

def initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest)
  @client = client
  @keys_whitelist = keys_whitelist
  @collector_type = collector_type

  super(**rest)
end

#platform_authorized(platform_key, &block) ⇒ Object



41
42
43
# File 'lib/graphql/tracing/prometheus_trace.rb', line 41

def platform_authorized(platform_key, &block)
  instrument_execution(platform_key, "authorized", &block)
end

#platform_authorized_key(type) ⇒ Object



61
62
63
# File 'lib/graphql/tracing/prometheus_trace.rb', line 61

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

#platform_authorized_lazy(platform_key, &block) ⇒ Object



45
46
47
# File 'lib/graphql/tracing/prometheus_trace.rb', line 45

def platform_authorized_lazy(platform_key, &block)
  instrument_execution(platform_key, "authorized_lazy", &block)
end

#platform_execute_field(platform_key, &block) ⇒ Object



33
34
35
# File 'lib/graphql/tracing/prometheus_trace.rb', line 33

def platform_execute_field(platform_key, &block)
  instrument_execution(platform_key, "execute_field", &block)
end

#platform_execute_field_lazy(platform_key, &block) ⇒ Object



37
38
39
# File 'lib/graphql/tracing/prometheus_trace.rb', line 37

def platform_execute_field_lazy(platform_key, &block)
  instrument_execution(platform_key, "execute_field_lazy", &block)
end

#platform_field_key(field) ⇒ Object



57
58
59
# File 'lib/graphql/tracing/prometheus_trace.rb', line 57

def platform_field_key(field)
  field.path
end

#platform_resolve_type(platform_key, &block) ⇒ Object



49
50
51
# File 'lib/graphql/tracing/prometheus_trace.rb', line 49

def platform_resolve_type(platform_key, &block)
  instrument_execution(platform_key, "resolve_type", &block)
end

#platform_resolve_type_key(type) ⇒ Object



65
66
67
# File 'lib/graphql/tracing/prometheus_trace.rb', line 65

def platform_resolve_type_key(type)
  "#{type.graphql_name}.resolve_type"
end

#platform_resolve_type_lazy(platform_key, &block) ⇒ Object



53
54
55
# File 'lib/graphql/tracing/prometheus_trace.rb', line 53

def platform_resolve_type_lazy(platform_key, &block)
  instrument_execution(platform_key, "resolve_type_lazy", &block)
end