Skip to content

tomcat jmx ignore negative thread and session limits#16355

Merged
laurit merged 5 commits intoopen-telemetry:mainfrom
SylvainJuge:jmx-tomcat-ignore-negative
Mar 10, 2026
Merged

tomcat jmx ignore negative thread and session limits#16355
laurit merged 5 commits intoopen-telemetry:mainfrom
SylvainJuge:jmx-tomcat-ignore-negative

Conversation

@SylvainJuge
Copy link
Copy Markdown
Contributor

@SylvainJuge SylvainJuge commented Mar 3, 2026

For tomcat.session.active.limit, when there is no limit configured the maxActiveSessions returns -1, thus we should ignore it.

For tomcat.thread.limit, the limit can't be configured at runtime, but there are cases where -1 is returned as indicated in tomcat documentation of the maxThreads MBean attribute.

The test webapp already sets the maxActiveSessions in META-INF/context.xml which means for Tomcat there was already an explicit upper limit and the tomcat.session.active.limit does not contain any negative value.

Also add full metric names in tomcat metrics definitions for consistency with other yaml files and making them easy to grep.

@SylvainJuge SylvainJuge self-assigned this Mar 3, 2026
…nstrumentation into jmx-tomcat-ignore-negative
@SylvainJuge
Copy link
Copy Markdown
Contributor Author

waiting on #16274 to be merged first to be able to add assertion on the metric values.

This would however not have prevented the issue to happen as there was already an explicit limit set in the test application, adding an assertion on the metric value just ensures that there is an explicit limit set in the test application. However, with such assertions on the metric value, removing both dropNegativeValues in tomcat.yaml and the maxActiveSessions in the test application would make the assertions on value fail.

@SylvainJuge SylvainJuge marked this pull request as ready for review March 9, 2026 11:17
@SylvainJuge SylvainJuge requested a review from a team as a code owner March 9, 2026 11:17
Copy link
Copy Markdown
Contributor

@robsunday robsunday left a comment

Choose a reason for hiding this comment

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

Looks good!

@laurit laurit merged commit 96fbd6a into open-telemetry:main Mar 10, 2026
177 of 179 checks passed
@SylvainJuge SylvainJuge deleted the jmx-tomcat-ignore-negative branch March 13, 2026 12:30
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.

3 participants