Many JMX enabled applications provides duration metrics with milliseconds unit, while semconv recommends using seconds.
Unit conversion mechanism is needed in order to fully support semconv. This mechanism must be usable from JMX metrics definition YAML files.
The final solution will be discussed, however there are some proposals already:
unitConverted YAML key that would replace unit wherever conversion is needed. It should take a value from predefined enumeration of possible conversions, like ms_to_s, ns_to_s, etc.
processingTime:
metric: processingTime
type: counter
unitConverted: ms_to_s
desc: Total time for processing all requests
- Similar
unitConverted YAML key but with different syntax. It would have 2 nested key/values: from indicating unit reported by the application, and to indicating required target unit.
processingTime:
metric: processingTime
type: counter
unitConverted:
from: ms
to: s
desc: Total time for processing all requests
- Optional
sourceUnit YAML tag that would indicate that there should be a conversion performed from this unit to the one specified in unit tag.
processingTime:
metric: processingTime
type: counter
sourceUnit: ms
unit: s
desc: Total time for processing all requests
if requested unit conversion is not possible then error should be reported after YAML file is loaded.
Many JMX enabled applications provides duration metrics with milliseconds unit, while semconv recommends using seconds.
Unit conversion mechanism is needed in order to fully support semconv. This mechanism must be usable from JMX metrics definition YAML files.
The final solution will be discussed, however there are some proposals already:
unitConvertedYAML key that would replaceunitwherever conversion is needed. It should take a value from predefined enumeration of possible conversions, likems_to_s,ns_to_s, etc.unitConvertedYAML key but with different syntax. It would have 2 nested key/values:fromindicating unit reported by the application, andtoindicating required target unit.sourceUnitYAML tag that would indicate that there should be a conversion performed from this unit to the one specified inunittag.if requested unit conversion is not possible then error should be reported after YAML file is loaded.