deadtrickster / prometheus_rabbitmq_exporter

Prometheus.io exporter as a RabbitMQ Managment Plugin plugin
MIT License
291 stars 72 forks source link

How to make this plugin work with rabbitmq 3.5.1? #82

Open lins05 opened 5 years ago

lins05 commented 5 years ago

Hi there, thanks for this great plugin. Recently I tried to install it with an old rabbitmq cluster running 3.5.1 but it seems not working.

At first I tried the latest version (following instructions on https://www.rabbitmq.com/prometheus.html) but the plugin can't be enabled (showing some error messages about "loading accept"). I guess it's because of 3.5.1 was built with an old erlang release, so I resolved to use this special build for R16B03.

With the special build the plugin can be enabled, but when I tried to access the /metrics endpoint it just returns 404:

curl -v http://localhost:15672/api/metrics
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 15672 (#0)
> GET /api/metrics HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:15672
> Accept: */*
>
< HTTP/1.1 404 Object Not Found
* Server MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) is not blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Wed, 29 May 2019 11:22:38 GMT
< Content-Type: application/json
< Content-Length: 55
<
* Connection #0 to host localhost left intact
{"error":"Object Not Found","reason":"\"Not Found\"\n"}(shuai)

My question: is it true that this plugin isn't compatible/tested with rabbitmq 3.5.1? If so, since I know a bit erlang, would there be much work involved to make it work with 3.5.1?

lins05 commented 5 years ago

btw this is the output of rabbitmq-plugins list:

[E*] accept                            0.3.3
[e*] amqp_client                       3.5.1
[E*] cowboy                            0.5.0-rmq3.5.1-git4b93c2d
[e*] mochiweb                          2.7.0-rmq3.5.1-git680dba8
[E*] prometheus                        3.4.0
[E*] prometheus_httpd                  2.1.4
[E*] prometheus_process_collector      1.1.0
[E*] prometheus_rabbitmq_exporter      v3.6.12.1
[  ] rabbitmq_amqp1_0                  3.5.1
[  ] rabbitmq_auth_backend_ldap        3.5.1
[  ] rabbitmq_auth_mechanism_ssl       3.5.1
[  ] rabbitmq_consistent_hash_exchange 3.5.1
[  ] rabbitmq_federation               3.5.1
[  ] rabbitmq_federation_management    3.5.1
[E*] rabbitmq_management               3.5.1
[e*] rabbitmq_management_agent         3.5.1
[  ] rabbitmq_management_visualiser    3.5.1
[  ] rabbitmq_mqtt                     3.5.1
[E*] rabbitmq_shovel                   3.5.1
[E*] rabbitmq_shovel_management        3.5.1
[  ] rabbitmq_stomp                    3.5.1
[  ] rabbitmq_test                     3.5.1
[  ] rabbitmq_tracing                  3.5.1
[e*] rabbitmq_web_dispatch             3.5.1
[  ] rabbitmq_web_stomp                3.5.1
[  ] rabbitmq_web_stomp_examples       3.5.1
[  ] sockjs                            0.3.4-rmq3.5.1-git3132eb9
[e*] webmachine                        1.10.3-rmq3.5.1-gite9359c7
deadtrickster commented 5 years ago

Yea I think I started with 3.6. No idea about the effort but 404 likely happens because registering handler done differently - a good starting point!