Skip to content

Conversation

@benoittgt
Copy link
Contributor

New Puma version has a nice addition of metric on busy threads.

busy_threads: running - how many threads are waiting to receive work + how many requests are waiting for a thread to pick them up. this is a "wholistic" stat reflecting the overall current state of work to be done and the capacity to do it.
source

@tanelsuurhans
Copy link

Any chance of this being merged?

@tgxworld
Copy link
Contributor

@benoittgt This looks good to me. Can you add a changelog entry before I merge this? thank you!

@benoittgt benoittgt force-pushed the add-requests_count branch from 01b19a3 to 255bf05 Compare April 17, 2025 06:57
@benoittgt
Copy link
Contributor Author

@tgxworld thanks for the review. It should be good. ;)

@benoittgt benoittgt force-pushed the add-requests_count branch from 255bf05 to 4193947 Compare April 17, 2025 07:06
Expose a prometheus metric new thread stats from Puma - puma/puma#3517
PrometheusExporterMiddlewareTest#test_redis_5_call_pipelined_patching: ArgumentError: wrong number of arguments (given 2, expected 3) test/test_helper.rb:12:in `call_pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client.rb:412:in `block (2 levels) in pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client/middlewares.rb:16:in `call' test/test_helper.rb:60:in `call_pipelined' lib/prometheus_exporter/instrumentation/method_profiler.rb:67:in `call_pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client.rb:411:in `block in pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client.rb:677:in `ensure_connected' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client.rb:409:in `pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client/pooled.rb:57:in `block in pipelined' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client/pooled.rb:30:in `block in with' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:110:in `block (2 levels) in with' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `handle_interrupt' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `block in with' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `handle_interrupt' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `with' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client/pooled.rb:26:in `with' /Users/benoit.tigeot/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/redis-client-0.19.1/lib/redis_client/pooled.rb:57:in `pipelined' test/middleware_test.rb:118:in `test_redis_5_call_pipelined_patching'
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
@benoittgt benoittgt force-pushed the add-requests_count branch from 4193947 to 7125d8d Compare April 17, 2025 07:09
@tgxworld
Copy link
Contributor

Sorry @benoittgt, can you fix the linting error before I merge. Thank you!

@benoittgt
Copy link
Contributor Author

Oups sorry. I've miss it @tgxworld. It should be good now.

@tgxworld tgxworld changed the title Add new metrics busy_threads from Puma FEATURE: Add new metrics busy_threads from Puma May 8, 2025
@tgxworld
Copy link
Contributor

tgxworld commented May 8, 2025

@benoittgt Sorry one last change before merging. The linting workflow is broken.

@benoittgt
Copy link
Contributor Author

No problem @tgxworld, I should have check.

@tgxworld tgxworld merged commit 8e3c307 into discourse:main May 9, 2025
11 of 12 checks passed
@benoittgt benoittgt deleted the add-requests_count branch May 19, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants