WildFly Metrics - How to send the metrics to Azure App Insights

119 views
Skip to first unread message

Tam Hoang

unread,
Sep 20, 2022, 10:55:10 AM9/20/22
to WildFly
Hi Wildfly developers,

My project uses WildFly 26.0.1.Final along with J2EE 6.
I add 
<extension module="org.wildfly.extension.microprofile.metrics-smallrye"/>
<subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:wildfly}"/>

to standalone.xml to support sending customized application metrics + wildly metrics so that I could see the result in http://localhost:9090/metrics (I could see the metrics)
# TYPE application_RFWK_Test_Count_Custom_Metric_total counter application_FWW_Test_Count_Custom_Metric_total 0.0 # TYPE application_ FWW  _Test_Timed_Custom_Metric_rate_per_second gauge application_ FWW  _Test_Timed_Custom_Metric_rate_per_second 0.0

# HELP wildfly_undertow_session_max_alive_time_seconds The longest time that an expired session had been alive # TYPE wildfly_undertow_session_max_alive_time_seconds gauge wildfly_undertow_session_max_alive_time_seconds{deployment="x.ear",subdeployment="x-ejb.jar",microprofile_scope="vendor"} 0.0 wildfly_undertow_session_max_alive_time_seconds{deployment="x.ear",subdeployment="x.war",microprofile_scope="vendor"} 0.0

Is there any way I could send these metrics to the Azure monitor (Azure App Insights)?

Thank you a lot!

Martin Choma

unread,
Oct 16, 2022, 10:32:33 AM10/16/22
to WildFly
Wildfly does not send metrics to monitoring tool. It is vice versa, it is monitoring tool which is pulling those metrics from Wildlfy regularly.  Simply by accessing  http://localhost:9090/metrics. Wildfly Metrics are in Prometheus format. So, as far as monitoring tool understand Prometheus format it can consume WildFly Metrics. Hope that helps.
Reply all
Reply to author
Forward
0 new messages