Skip to content

JMX: Tomcat sessions is always exported as 0 #1360

@sky333999

Description

@sky333999

Component(s)

jmx-metrics

What happened?

Description

When using tomcat as the target system for jmx-metrics, tomcat.sessions is always emitted as 0 despite the MXBeans showing a non-zero value for the activeSessions attribute.

Steps to Reproduce

  • Spin up a tomcat server and install any sample web app that leverages sessions on it.
  • Create sessions and confirm by looking at the Tomcat manager that sessions is non-zero.
image In this example, **shoppingcart** is a sample app and as can be seen, the sessions count is 1.
  • Use a tool such as jconsole or jmxterm to query MXBeans and confirm activeSessions is non-zero.
$>get -b Catalina:context=/shoppingcart,host=localhost,type=Manager activeSessions
#mbean = Catalina:context=/shoppingcart,host=localhost,type=Manager:
activeSessions = 1;

The above is the output from jmxterm to query the MXBeans. As can be seen, the value matches the expectation.

  • Observe the value of tomcat.sessions coming from jmx-metrics. For example, setup an OTel collector pipeline with a JMX receiver and debug exporter.

Expected Result

I expect the value of tomcat.sessions as per the definition here to also be non-zero.

Actual Result

The value of tomcat.sessions is always 0.

Component version

v1.35.0

Log output

No response

Additional context

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions