Skip to content

JMX Metrics with yaml: needed unit conversion mechanism #13369

@robsunday

Description

@robsunday

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:

  1. 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 
  1. 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 
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions