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
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
|
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
|
61
62
63
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 61
def platform_authorized_key(type)
"#{type.graphql_name}.authorized"
end
|
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
|
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
|
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
|
57
58
59
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 57
def platform_field_key(field)
field.path
end
|
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
|
65
66
67
|
# File 'lib/graphql/tracing/prometheus_trace.rb', line 65
def platform_resolve_type_key(type)
"#{type.graphql_name}.resolve_type"
end
|
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
|