Skip to content

Commit

Permalink
Specify “most recent” aggregation mode for all gauge metrics (#16)
Browse files Browse the repository at this point in the history
This change updates all of the gauges to include "most recent" aggregation mode introduced in prometheus-client 2.1.0. This is safe for both single- and multi-process mode because only the DirectFileStore from prometheus-client handles the aggregation option -- there is no aggregation to be done in single-process mode or with other adapters.

Fixes #15
  • Loading branch information
botimer authored Feb 5, 2021
1 parent 8519f4f commit 2709126
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/puma/plugin/yabeda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def start(launcher)
Yabeda.configure do
group :puma

gauge :backlog, tags: %i[index], comment: 'Number of established but unaccepted connections in the backlog'
gauge :running, tags: %i[index], comment: 'Number of running worker threads'
gauge :pool_capacity, tags: %i[index], comment: 'Number of allocatable worker threads'
gauge :max_threads, tags: %i[index], comment: 'Maximum number of worker threads'
gauge :backlog, tags: %i[index], comment: 'Number of established but unaccepted connections in the backlog', aggregation: :most_recent
gauge :running, tags: %i[index], comment: 'Number of running worker threads', aggregation: :most_recent
gauge :pool_capacity, tags: %i[index], comment: 'Number of allocatable worker threads', aggregation: :most_recent
gauge :max_threads, tags: %i[index], comment: 'Maximum number of worker threads', aggregation: :most_recent

if clustered
gauge :workers, comment: 'Number of configured workers'
gauge :booted_workers, comment: 'Number of booted workers'
gauge :old_workers, comment: 'Number of old workers'
gauge :workers, comment: 'Number of configured workers', aggregation: :most_recent
gauge :booted_workers, comment: 'Number of booted workers', aggregation: :most_recent
gauge :old_workers, comment: 'Number of old workers', aggregation: :most_recent
end

collect do
Expand Down

0 comments on commit 2709126

Please sign in to comment.