emqx / emqx-exporter

Prometheus exporter for EMQX
https://www.emqx.com
Apache License 2.0
26 stars 8 forks source link

avoid calling v4 api #52

Open zmstone opened 1 year ago

zmstone commented 1 year ago

this version probing will generate some suspicious logs in emqx v5. https://github.com/emqx/emqx-exporter/blob/16b7648d23458e9a55b2258fa39a80ee5260dd70/client/cluster.go#L53-L84

an alternative is to try to call the /status endpoint with ?format=json, in v4 it will return text (ignore the json arg). in v5 it returns a json like below

curl -s 'http://127.0.0.1:18083/status?format=json'
{"rel_vsn":"e5.1.1","node_name":"emqx@127.0.0.1","broker_status":"started","app_status":"running"}