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
-
#initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest) ⇒ Object
-
#platform_authorized(platform_key, &block) ⇒ Object
-
#platform_authorized_key(type) ⇒ Object
-
#platform_authorized_lazy(platform_key, &block) ⇒ Object
-
#platform_execute_field(platform_key, &block) ⇒ Object
-
#platform_execute_field_lazy(platform_key, &block) ⇒ Object
-
#platform_field_key(field) ⇒ Object
-
#platform_resolve_type(platform_key, &block) ⇒ Object
-
#platform_resolve_type_key(type) ⇒ Object
-
#platform_resolve_type_lazy(platform_key, &block) ⇒ Object
Instance Method Details
#initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest) ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 13
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
|
46
47
48
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 46
def platform_authorized(platform_key, &block)
instrument_prometheus_execution(platform_key, "authorized", &block)
end
|
66
67
68
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 66
def platform_authorized_key(type)
"#{type.graphql_name}.authorized"
end
|
50
51
52
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 50
def platform_authorized_lazy(platform_key, &block)
instrument_prometheus_execution(platform_key, "authorized_lazy", &block)
end
|
38
39
40
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 38
def platform_execute_field(platform_key, &block)
instrument_prometheus_execution(platform_key, "execute_field", &block)
end
|
42
43
44
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 42
def platform_execute_field_lazy(platform_key, &block)
instrument_prometheus_execution(platform_key, "execute_field_lazy", &block)
end
|
62
63
64
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 62
def platform_field_key(field)
field.path
end
|
54
55
56
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 54
def platform_resolve_type(platform_key, &block)
instrument_prometheus_execution(platform_key, "resolve_type", &block)
end
|
70
71
72
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 70
def platform_resolve_type_key(type)
"#{type.graphql_name}.resolve_type"
end
|
58
59
60
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 58
def platform_resolve_type_lazy(platform_key, &block)
instrument_prometheus_execution(platform_key, "resolve_type_lazy", &block)
end
|