Skip to content

Commit

Permalink
Update README.md - Add metrics setup instructions for puma single mode (
Browse files Browse the repository at this point in the history
  • Loading branch information
oozzal committed Apr 9, 2024
1 parent e23bac5 commit 66c1f39
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -583,6 +583,17 @@ The puma metrics are using the `Puma.stats` method and hence need to be started
workers has been booted and from a Puma thread otherwise the metrics won't be accessible.
The easiest way to gather this metrics is to put the following in your `puma.rb` config:

For Puma single mode
```ruby
# puma.rb config
require 'prometheus_exporter/instrumentation'
# optional check, avoids spinning up and down threads per worker
if !PrometheusExporter::Instrumentation::Puma.started?
PrometheusExporter::Instrumentation::Puma.start
end
```

For Puma clustered mode
```ruby
# puma.rb config
after_worker_boot do
Expand Down

0 comments on commit 66c1f39

Please sign in to comment.