Some Metrics are always zero

114 views
Skip to first unread message

1h0m5s

unread,
Mar 18, 2024, 5:21:40 AMMar 18
to WildFly
Hello Everyone,

We are using WildFly 31.0.1.Final and are trying to setup some monitoring. Therefore, we are using the Micrometer subsystem to export the metrics. Here is my standalone.xml configuration:

<subsystem xmlns="urn:wildfly:micrometer:1.1" exposed-subsystems="*">
  <otlp-registry endpoint="${env.MICROMETER_ENDPOINT:http://localhost:4318/v1/metrics}" step="${env.MICROMETER_STEP:15}"/>
</subsystem>

During my test I observed that the following metrics are always reporting the value 0.

cpu_system_load_average
cpu_available_processors
thread_count
thread_daemon_count
thread_max_count
classloader_loaded_classes_count
classloader_loaded_classes_total
classloader_unloaded_classes_total

I configured already the "statistics-enabled" flag for datasources, transactions, and undertow.

How can I get these values?

Best regards,
Thomas



Roland Spindelbalker-Davila

unread,
Mar 20, 2024, 11:06:28 AMMar 20
to WildFly
This seems to be caused by a faulty extraction of the related MBean values, I opened a ticket for the bug: https://issues.redhat.com/browse/WFLY-19151

BR,
Roland Spindelbalker-Davila

Jason Lee

unread,
Mar 26, 2024, 6:38:19 PMMar 26
to Roland Spindelbalker-Davila, WildFly
Thanks for raising the issue and the detailed report. You did half the work for me. :) I have PR opened here: https://github.com/wildfly/wildfly/pull/17759

Jason Lee

Principal Software Engineer

Red Hat JBoss EAP



--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/00b2436c-29ea-4b62-abca-a04e6e7044d0n%40googlegroups.com.

Rudi Araújo

unread,
Jul 1, 2024, 3:57:01 AM (6 days ago) Jul 1
to WildFly
Hi folks,

I'm having the same issue but with the undertow metrics - they are reported, but consistently as 0, despite making several HTTP requests. I'm using WildFly 29.0.1.

I made sure that the undertow subsystem has the statistics-enabled attribute turned on:

[standalone@localhost:9990 /] /subsystem=undertow:read-resource
{
    "outcome" => "success",
    "result" => {
        "default-security-domain" => "other",
        "default-server" => "default-server",
        "default-servlet-container" => "default",
        "default-virtual-host" => "default-host",
        "instance-id" => expression "${jboss.node.name}",
        "obfuscate-session-route" => false,
        "statistics-enabled" => true,
        "application-security-domain" => {"other" => undefined},
        "buffer-cache" => {"default" => undefined},
        "byte-buffer-pool" => {"default" => undefined},
        "configuration" => {
            "filter" => undefined,
            "handler" => undefined
        },
        "server" => {"default-server" => undefined},
        "servlet-container" => {"default" => undefined}
    }
}


I made sure that the micrometer subsystem is exposing all subsystems (even tried with ["undertow"] only):

[standalone@localhost:9990 /] /subsystem=micrometer:read-resource
{
    "outcome" => "success",
    "result" => {
        "exposed-subsystems" => ["*"],
        "endpoint" => expression "${OTEL_COLLECTOR_URL}",
        "step" => 1L
    }
}



I made sure the wildfly.statistics-enabled and wildfly.undertow.statistics-enabled system props are set to true.

I tried with and without the metrics subsystem enabled - same result. One thing I did notice is that when the metrics subsystem is enabled, it doesn't report any undertow metrics at all (not even at 0). I suspect these issues might be related.

If it helps, here is the config I'm using, slightly modified to remove the management HTTPS port. And the CLI commands I'm using to enable micrometer:

if (outcome != success) of /extension=org.wildfly.extension.micrometer:read-resource
    /extension=org.wildfly.extension.micrometer:add
    /subsystem=micrometer:add()
end-if


/subsystem=micrometer:write-attribute(name=endpoint, value="${OTEL_COLLECTOR_URL}")
/subsystem=micrometer:write-attribute(name=step, value=1)

/subsystem=undertow:write-attribute(name=statistics-enabled, value=true)

And of course I'm reloading the server after this (and also tried shutdown --restart=true)

I have run out of ideas to pursue - I have tried going through the WildFly code but couldn't find any reason for the behaviour. Some help or guidance would be much appreciated.

Thanks for your time!

Kind regards,
Rudi Araújo.

Jason Lee

unread,
Jul 5, 2024, 4:27:48 PM (2 days ago) Jul 5
to Rudi Araújo, WildFly
Which metrics specifically are you interested in? I'll try to recreate the failure locally...

Jason Lee

Principal Software Engineer

Red Hat JBoss EAP

Java Champion



Reply all
Reply to author
Forward
0 new messages