align jmx state metrics with semconv #15093
Open
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.
Fixes #14753
1where it was previously""(empty string)In the existing semantic conventions, there are at least two examples of "state metrics" that already use
1as unit, so it is probably simpler to align to semconv than try to change semconv to use an empty metric.hw.status(network)hw.network.upOnly the state metric unit changes, so while it's technically a breaking change I think the impact should be quite limited:
1as unit is used mostly for fractions of something, usually with values between 0.0 and 1.0.So, in the current state I don't think this requires to have a dedicated configurable toggle to leave this breaking change for 3.0, however I don't mind taking the "extra safe" way and add a config option just to make the transition smoother.
In addition, due to how the feature is currently built, the configuration options are not automatically propagated to usages of the library like in the jmx-scraper so adding a new configuration option would require to also implement it in every usage of the library, then deprecate and revert the change. This inconvenience might be removed once #14674 is completed, but I'm not 100% sure about that, so in the mean time it's probably simpler to deal with what appears to be a minor breaking change.