Module: Pechkin::PrometheusUtils

Defined in:
lib/pechkin/prometheus_utils.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.registryObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/pechkin/prometheus_utils.rb', line 4

def registry
  registry = ::Prometheus::Client.registry
  registry.gauge(:pechkin_start_time_seconds,
                 docstring: 'Startup timestamp').set(Time.now.to_i)

  version_labels = { version: Pechkin::Version.version_string }
  registry.gauge(:pechkin_version,
                 docstring: 'Pechkin version', labels: [:version])
          .set(1, labels: version_labels)

  registry
end