Class: Sbmt::Outbox::Probes::Metrics

Inherits:
Object
  • Object
show all
Defined in:
lib/sbmt/outbox/probes/metrics.rb

Constant Summary collapse

DEFAULT_YABEDA_PORT =
9090
DEFAULT_YABEDA_PATH =
"/metrics"

Class Method Summary collapse

Class Method Details

.run_metricsObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sbmt/outbox/probes/metrics.rb', line 10

def run_metrics
  return unless autostart_yabeda_server?

  if defined?(Yabeda)
    $stdout.puts "Starting metrics http-server..."

    start_webrick(
      Yabeda::Prometheus::Mmap::Exporter::NOT_FOUND_HANDLER,
      middlewares: {::Yabeda::Prometheus::Exporter => {path: DEFAULT_YABEDA_PATH}},
      port: yabeda_port
    )
  end
end