discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
532 stars 154 forks source link

Inconsistent puma workers metrics #183

Closed arthurwozniak closed 3 years ago

arthurwozniak commented 3 years ago

Hi, I was just digging into exporter metrics and setted up grafana alert when puma workers goes below specific threshold. I have noticed strange behavior that puma_workers_total and puma_booted_workers_total are oscilating between zero and expected value.

My setup is

# puma/production.rb
after_worker_boot do
  require 'prometheus_exporter/instrumentation'
  PrometheusExporter::Instrumentation::Puma.start
end

env: puma (5.4.0) rails (6.1.4) prometheus_exporter (0.8.1) ruby 3.0.2

Resulting metrics looks like image

image

On the other hand, monitoring of puma threads is always correct. Rails log / systemd log does not contain even warning message. Any idea where to look further, please?

arthurwozniak commented 3 years ago

Closing this issue as the only problem is on my side. Default export frequency is 30s, so I need to modify my query.