Module: PhobosPrometheus

Extended by:
Logger
Defined in:
lib/phobos_prometheus.rb,
lib/phobos_prometheus/errors.rb,
lib/phobos_prometheus/logger.rb,
lib/phobos_prometheus/version.rb,
lib/phobos_prometheus/exporter.rb,
lib/phobos_prometheus/collector.rb,
lib/phobos_prometheus/config_parser.rb,
lib/phobos_prometheus/collector/gauge.rb,
lib/phobos_prometheus/exporter_helper.rb,
lib/phobos_prometheus/collector/helper.rb,
lib/phobos_prometheus/collector/counter.rb,
lib/phobos_prometheus/collector/histogram.rb,
lib/phobos_prometheus/collector/error_logger.rb

Overview

Prometheus collector for Phobos

Defined Under Namespace

Modules: Collector, Helper, Logger Classes: BucketsValidator, ConfigParser, CountersValidator, Error, Exporter, ExporterHelper, GaugesValidator, HistogramsValidator, InvalidConfigurationError

Constant Summary collapse

VERSION =
'0.3.2'

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Logger

log_error, log_info, log_warn

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



28
29
30
# File 'lib/phobos_prometheus.rb', line 28

def config
  @config
end

.metricsObject (readonly)

Returns the value of attribute metrics.



28
29
30
# File 'lib/phobos_prometheus.rb', line 28

def metrics
  @metrics
end

Class Method Details

.configure(path) ⇒ Object

Public - configure and validate configuration



31
32
33
34
35
36
# File 'lib/phobos_prometheus.rb', line 31

def configure(path)
  @metrics ||= []
  @config = ConfigParser.new(path).config

  log_info('PhobosPrometheus configured')
end

.subscribeObject

Public - after configured create the prometheus metrics



39
40
41
42
43
44
45
46
47
# File 'lib/phobos_prometheus.rb', line 39

def subscribe
  subscribe_counters
  subscribe_histograms
  subscribe_gauges

  log_info('PhobosPrometheus subscribed') unless @metrics.empty?

  self
end