Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tomcat ThreadPool connectionCount metric. #1595

Conversation

rafal-dudek
Copy link
Contributor

@rafal-dudek rafal-dudek commented Sep 20, 2019

This PR adds metric for connectionCount attribute from "Tomcat:name=*,type=ThreadPool" mBean.

Fixes #1598

@@ -147,6 +147,12 @@ private void registerThreadPoolMetrics(MeterRegistry registry) {
.tags(allTags)
.baseUnit(BaseUnits.THREADS)
.register(registry);

Gauge.builder("tomcat.threads.active", mBeanServer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the connectionCount necessarily equal to the number of active threads in the thread pool? Starting an application locally and looking at the MBean, I see maxThreads is 200, but maxConnections is 10,000.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set baseUnit to "connections", so whole metric is "tomcat_threads_active_connections".
Maybe you have a suggestion for a better name?

@shakuzen
Copy link
Member

Sorry to not follow-up on this pull request so I could merge this. Thanks for proposing it, but I have recently merged #2248 which supersedes this one. It includes the connectionCount as well as a couple other metrics.

@shakuzen shakuzen closed this Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing connectionCount metric in TomcatMetrics
2 participants