-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Puma Stats as Prometheus Metrics
The PeriodicUpdater fetches statistics [1] from Puma every 30 seconds and uses the PrometheusUpdater to send the following metrics: - cc_puma_worker_count - cc_puma_worker_started_at (per worker with labels index and pid) - cc_puma_worker_thread_count (per worker) - cc_puma_worker_backlog (per worker) - docs: "requests that are waiting for an available thread" - seems like a good scaling indicator As we want to label worker metrics with the worker's pid (although issued by the main process), the BASE_RESERVED_LABELS constant within the Prometheus::Client had to be modified (monkey patched). [1] https://puma.io/puma/file.stats.html
- Loading branch information
1 parent
64115aa
commit 118df23
Showing
4 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters