Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-26861

[GSS] WFLY-19151 - Several metrics are not loaded correctly from their MBean

XMLWordPrintable

    • False
    • None
    • False
    • Hide

      1.) Configure the micrometer subsystem to publish the metrics (e.g. to an otel collector)

      2.) Check the listed metrics there (e.g. thread_count), the value will always be 0

      3.) Debug into the JmxMicrometerCollector to see the thrown exception in line 210 (https://github.com/wildfly/wildfly/blob/0cb7ee54f3c073eda932030d5b47ceee1674eae9/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/jmx/JmxMicrometerCollector.java#L210)

      Show
      1.) Configure the micrometer subsystem to publish the metrics (e.g. to an otel collector) 2.) Check the listed metrics there (e.g. thread_count), the value will always be 0 3.) Debug into the JmxMicrometerCollector to see the thrown exception in line 210 ( https://github.com/wildfly/wildfly/blob/0cb7ee54f3c073eda932030d5b47ceee1674eae9/observability/micrometer/src/main/java/org/wildfly/extension/micrometer/jmx/JmxMicrometerCollector.java#L210 )

      When updating our Grafana dashboards to the new metric names and format published by the micrometer subsystem, we noticed that several metrics are present, but always report the value 0. Upon closer inspection (and some debugging) we found out that those metrics are all based on JMX MBeans. Their names and MBean attributes seem to be taken from the properties file jmx-metrics.properties. And exactly there the bug occurs, because the actual attribute for them is named differently, e.g. in this case:

      Here the derived attribute name is PeakThread_count, while the actual attribute from the MBean is called PeakThreadCount.
      The exception is later swallowed and the optional value of the metric is not set, therefore the value is always 0.

      As far as we know, this affects the following metrics:

      • thread_max_count
      • classloader_loaded_classes
      • cpu_system_load_average
      • cpu_process_cpu_time
      • classloader_unloaded_classes
      • classloader_loaded_classes_count
      • thread_count
      • thread_daemon_count
      • cpu_available_processors

            rhn-engineering-lgao Lin Gao
            chaowan@redhat.com Chao Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: