module Yabeda::Prometheus

Constants

VERSION

Public Class Methods

push_gateway() click to toggle source
# File lib/yabeda/prometheus.rb, line 17
def push_gateway
  @push_gateway ||= begin
    ::Prometheus::Client::Push.new(
      ENV.fetch("PROMETHEUS_JOB_NAME", "yabeda"),
      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
registry() click to toggle source
# File lib/yabeda/prometheus.rb, line 13
def registry
  ::Prometheus::Client.registry
end