rh-messaging / artemis-prometheus-metrics-plugin

Apache License 2.0
22 stars 20 forks source link

[#19] check server state when serving requests #28

Closed brusdev closed 2 months ago

erwindon commented 6 months ago

I have no further comments on the code-changes. I'll try to use the resulting jar now.

erwindon commented 6 months ago

(accidentally) tried it with 2.31.2 when retrieving "http://.../metrics" it fails (as expected?):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Prometheus meter registry is null. Has the Prometheus Metrics Plugin been configured?</title>
</head>
<body><h2>HTTP ERROR 404 Prometheus meter registry is null. Has the Prometheus Metrics Plugin been configured?</h2>
<table>
<tr><th>URI:</th><td>/metrics/</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Prometheus meter registry is null. Has the Prometheus Metrics Plugin been configured?</td></tr>
<tr><th>SERVLET:</th><td>artemis-prometheus-metrics-plugin-servlet</td></tr>
</table>

</body>
</html>

that leaves room for a small improvement. e.g. "Prometheus meter registry is null. This plugin needs at least ActiveMQ Artemis 2.32.0. [...]"

erwindon commented 6 months ago

and with 2.32.0 it seems to have the same result ("Prometheus meter registry is null")

erwindon commented 6 months ago

I'll be away for a week now...

brusdev commented 6 months ago

@erwindon I fixed both the backward compatibility issue and the bug you found pushing a different solution.

erwindon commented 5 months ago

I was finally able to test this again and found no problems this time. I did a total of 20 Artemis node restarts and did not see the stack traces that originally sometimes happened. metrics can be collected ok. btw: the version number of the plugin was not changed yet, but that may be standard procedure.

brusdev commented 2 months ago

@erwindon thanks for your feedback, I'll create a release tag with the updated version after merging this PR.

brusdev commented 2 months ago

Fix included in the release tag https://github.com/rh-messaging/artemis-prometheus-metrics-plugin/releases/tag/v2.2.0