Module: GraphQL::Tracing::PrometheusTrace

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

Defined Under Namespace

Classes: GraphQLCollector, PrometheusMonitor

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prometheus_clientObject (readonly)

Returns the value of attribute prometheus_client.



43
44
45
# File 'lib/graphql/tracing/prometheus_trace.rb', line 43

def prometheus_client
  @prometheus_client
end

#prometheus_collector_typeObject (readonly)

Returns the value of attribute prometheus_collector_type.



43
44
45
# File 'lib/graphql/tracing/prometheus_trace.rb', line 43

def prometheus_collector_type
  @prometheus_collector_type
end

#prometheus_keys_whitelistObject (readonly)

Returns the value of attribute prometheus_keys_whitelist.



43
44
45
# File 'lib/graphql/tracing/prometheus_trace.rb', line 43

def prometheus_keys_whitelist
  @prometheus_keys_whitelist
end

Instance Method Details

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



35
36
37
38
39
40
41
# File 'lib/graphql/tracing/prometheus_trace.rb', line 35

def initialize(client: PrometheusExporter::Client.default, keys_whitelist: [:execute_field], collector_type: "graphql", **rest)
  @prometheus_client = client
  @prometheus_keys_whitelist = keys_whitelist.map(&:to_sym) # handle previous string keys
  @prometheus_collector_type = collector_type
  setup_prometheus_monitor(**rest)
  super
end