class GraphQL::Tracing::PrometheusTracing
Constants
- DEFAULT_COLLECTOR_TYPE
- DEFAULT_WHITELIST
- GraphQLCollector
-
Backwards-compat:
Public Class Methods
Source
# File lib/graphql/tracing/prometheus_tracing.rb, line 25 def initialize(opts = {}) @client = opts[:client] || PrometheusExporter::Client.default @keys_whitelist = opts[:keys_whitelist] || DEFAULT_WHITELIST @collector_type = opts[:collector_type] || DEFAULT_COLLECTOR_TYPE super opts end
Calls superclass method
Public Instance Methods
# File lib/graphql/tracing/prometheus_tracing.rb, line 38 def platform_field_key(type, field) "#{type.graphql_name}.#{field.graphql_name}" end
# File lib/graphql/tracing/prometheus_tracing.rb, line 46 def platform_resolve_type_key(type) "#{type.graphql_name}.resolve_type" end
# File lib/graphql/tracing/prometheus_tracing.rb, line 33 def platform_trace(platform_key, key, _data, &block) return yield unless @keys_whitelist.include?(key) instrument_execution(platform_key, key, &block) end