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_client ⇒ Object (readonly)

Returns the value of attribute prometheus_client.



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

def prometheus_client
  @prometheus_client
end

#prometheus_collector_type ⇒ Object (readonly)

Returns the value of attribute prometheus_collector_type.



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

def prometheus_collector_type
  @prometheus_collector_type
end

#prometheus_keys_whitelist ⇒ Object (readonly)

Returns the value of attribute prometheus_keys_whitelist.



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

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



45
46
47
48
49
50
51
# File 'lib/graphql/tracing/prometheus_trace.rb', line 45

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