Class: EventTracer::PrometheusLogger

Inherits:
BasicDecorator show all
Defined in:
lib/event_tracer/prometheus_logger.rb

Constant Summary collapse

SUPPORTED_METRIC_TYPES =
{
  counter: :increment_count,
  gauge: :set_gauge
}.freeze
DEFAULT_INCREMENT =
1

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicDecorator

#__getobj__, #__setobj__, #fail_result, #success_result

Constructor Details

#initialize(prometheus, allowed_tags: [], default_tags: {}, raise_if_missing: true) ⇒ PrometheusLogger

Returns a new instance of PrometheusLogger.



12
13
14
15
16
17
# File 'lib/event_tracer/prometheus_logger.rb', line 12

def initialize(prometheus, allowed_tags: [], default_tags: {}, raise_if_missing: true)
  super(prometheus)
  @allowed_tags = allowed_tags.freeze
  @default_tags = default_tags.freeze
  @raise_if_missing = raise_if_missing
end

Instance Attribute Details

#allowed_tagsObject (readonly)

Returns the value of attribute allowed_tags.



10
11
12
# File 'lib/event_tracer/prometheus_logger.rb', line 10

def allowed_tags
  @allowed_tags
end