Skip to content

Conversation

@SylvainJuge
Copy link
Contributor

Fixes #14190

The addition of metrics unit conversion in JMX metrics (#13448) combined with using empty unit for
state metrics (#13796) introduced a regression in 2.17.0 as the UnitConverter.getInstance(...) call throws an exception when called with an empty target unit, which is now always the case with state metrics.

An exception was thrown which probably makes the JMX bean detection fail silently, this behavior was not explicitly tested so the simplest approach is probably to return null unit converter instance when we use it with an empty unit.

@SylvainJuge SylvainJuge self-assigned this Jul 7, 2025
@SylvainJuge SylvainJuge marked this pull request as ready for review July 7, 2025 15:46
@SylvainJuge SylvainJuge requested a review from a team as a code owner July 7, 2025 15:46
@trask trask merged commit 9c2bea5 into open-telemetry:main Jul 7, 2025
89 checks passed
@SylvainJuge SylvainJuge deleted the fix-jmx-state-metrics branch July 8, 2025 07:43
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.

State Metrics for JMX MBeans not generated with OpenTelemetry Java Agent 2.17.0

4 participants