rh-messaging / artemis-prometheus-metrics-plugin

Apache License 2.0
22 stars 20 forks source link

Possible race when servlet discovers registry? #25

Open jbertram opened 7 months ago

jbertram commented 7 months ago

This report comes from ASF Slack:

Hi, I've enabled Artemis Prometheus metrics as follow in my broker.xml:

<metrics>
  <plugin class-name="org.apache.activemq.artemis.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"/>
</metrics>

It works most of the time and I'm able to get Prometheus metrics. However, randomly (usually after node restart) some nodes don't have metrics anymore and display the following error:

HTTP ERROR 404 Prometheus meter registry is null. Has the Prometheus Metrics Pluging been configured?

There is no visible difference in logs produced by a node having metrics and a node having no metrics. I don't know how to reproduce it. As a workaround, I have found that metrics can be enabled again by calling the JMX restartEmbeddedWebServer() to restart the Jetty server. Have you already seen something like that?