Module: Evil::Metrics::Prometheus

Defined in:
lib/evil/metrics/prometheus.rb,
lib/evil/metrics/prometheus/version.rb,
lib/evil/metrics/prometheus/exporter.rb

Defined Under Namespace

Classes: Adapter, CounterWrapper, Exporter, GaugeWrapper, MetricWrapper

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.push_gatewayObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/evil/metrics/prometheus.rb', line 16

def push_gateway
  @push_gateway ||= begin
    ::Prometheus::Client::Push.new(
      ENV.fetch("PROMETHEUS_JOB_NAME", "evil-metrics"),
      nil,
      ENV.fetch("PROMETHEUS_PUSH_GATEWAY", "http://localhost:9091"),
    ).tap do |gateway|
      http = gateway.instance_variable_get(:@http)
      http.open_timeout = 5
      http.read_timeout = 5
    end
  end
end

.registryObject



12
13
14
# File 'lib/evil/metrics/prometheus.rb', line 12

def registry
  ::Prometheus::Client.registry
end