Update Jetty thread pool metrics#18883
Merged
abhishekrb19 merged 5 commits intoapache:masterfrom Jan 5, 2026
Merged
Conversation
ae1b289 to
c1cfd79
Compare
jtuglu1
approved these changes
Jan 5, 2026
Contributor
jtuglu1
left a comment
There was a problem hiding this comment.
Minor comments – thanks.
docs/operations/metrics.md
Outdated
| |`jetty/threadPool/busy`|Number of busy threads that has work to do from the worker queue.|Less than or equal to `threadPoolNumTotalThreads`.| | ||
| |`jetty/threadPool/isLowOnThreads`|A rough indicator of whether number of total workable threads allocated is enough to handle the works in the work queue.|0| | ||
| |`jetty/threadPool/total`|Number of total workable threads allocated. This includes internal threads and threads that are ready to serve requests.|Equals the total number of usable threads in the Jetty thread pool (idle + busy).| | ||
| |`jetty/threadPool/ready`| Number of threads that are ready to serve requests. | Equals the total number of usable threads in the Jetty thread pool to serve requests (idle + busy).| |
Contributor
There was a problem hiding this comment.
nit: spacing on the markdown |.
docs/operations/metrics.md
Outdated
| |`jetty/threadPool/isLowOnThreads`|A rough indicator of whether number of total workable threads allocated is enough to handle the works in the work queue.|0| | ||
| |`jetty/threadPool/total`|Number of total workable threads allocated. This includes internal threads and threads that are ready to serve requests.|Equals the total number of usable threads in the Jetty thread pool (idle + busy).| | ||
| |`jetty/threadPool/ready`| Number of threads that are ready to serve requests. | Equals the total number of usable threads in the Jetty thread pool to serve requests (idle + busy).| | ||
| |`jetty/threadPool/utilized`| Number of threads currently in use by the thread pool to serve requests. | Typically well below ready.| |
Contributor
There was a problem hiding this comment.
Can we frame this as an inequality?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jetty recommends getReadyThreads() and getUtilizedThreads() instead of
getIdleThreads()andgetBusyThreads(). The former (and the new metricsjetty/threadPool/readyandjetty/threadPool/utilized) are intended to capture the portion of the thread pool that is actually available for serving requests (short, transient jobs).Otoh the latter also capture the state of internal system threads that are reserved and/or leased for internal Jetty mechanics.
I noticed on busy servers with sustained query load where the “busy” thread count appeared to be constantly saturated, likely because threads leased for thread pool maintenance were being deprioritized even though "isLowOnThreads" was not 1.
It's also useful to get the utilization rate of the thread pool that's serving requests to understand thread pool usage patterns for different servers:
jetty/threadPool/utilizationRateAlso update the documentation for the new metrics and also fixes up descriptions for some existing Jetty metrics.
Release note
Add new Jetty thread pool metrics to capture request-serving thread statistics:
jetty/threadPool/utilized,jetty/threadPool/readyandjetty/threadPool/utilizationRate.This PR has: