kbudde / rabbitmq_exporter

Prometheus exporter for RabbitMQ
MIT License
689 stars 197 forks source link

Error while retrieving data from rabbitHost #97

Closed GuillaumeRossolini closed 6 years ago

GuillaumeRossolini commented 6 years ago

Hi,

I am fairly new to Prometheus, so please forgive me if the question has been answered somewhere. This is likely a setup issue.

I have installed the exporter and configured it as a service, and it appeared to work (showed up as "UP" in Prometheus). Unfortunately, no data was available in Grafana so I stopped the service and started debugging the exporter, which now looks something like this:

RABBIT_TIMEOUT=5 LOG_LEVEL=debug SKIPVERIFY=true PUBLISH_ADDR=... PUBLISH_PORT=9419 RABBIT_CAPABILITIES=no_sort,bert RABBIT_USER="..." RABBIT_PASSWORD="..." /usr/local/bin/rabbitmq_exporter

The console now displays several lines like this:

ERRO[0002] Error while retrieving data from rabbitHost error="" host="http://localhost:15672" statusCode=406

However, when I use the same credentials with cURL, it works:

$ curl --basic -u"..." -i http://localhost:15672/api/users
HTTP/1.1 200 OK
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Tue, 28 Aug 2018 16:35:31 GMT
Content-Type: application/json
Content-Length: 260
Cache-Control: no-cache

[{"name":"guest",...]

RabbitMQ is indeed running:

# netstat -peanut | grep LISTEN | grep 15672
tcp        0      0 127.0.0.1:15672         0.0.0.0:*               LISTEN      109        3011911519  30368/beam.smp

Here is my list of plugins, maybe I'm missing one:

# rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:   * = running on rabbit@prod-front1
 |/
[e*] amqp_client                       3.5.6
[  ] cowboy                            0.5.0-rmq3.5.6-git4b93c2d
[e*] mochiweb                          2.7.0-rmq3.5.6-git680dba8
[  ] rabbitmq_amqp1_0                  3.5.6
[  ] rabbitmq_auth_backend_ldap        3.5.6
[  ] rabbitmq_auth_mechanism_ssl       3.5.6
[  ] rabbitmq_consistent_hash_exchange 3.5.6
[  ] rabbitmq_federation               3.5.6
[  ] rabbitmq_federation_management    3.5.6
[E*] rabbitmq_management               3.5.6
[e*] rabbitmq_management_agent         3.5.6
[  ] rabbitmq_management_visualiser    3.5.6
[  ] rabbitmq_mqtt                     3.5.6
[  ] rabbitmq_shovel                   3.5.6
[  ] rabbitmq_shovel_management        3.5.6
[  ] rabbitmq_stomp                    3.5.6
[  ] rabbitmq_test                     3.5.6
[E*] rabbitmq_tracing                  3.5.6
[e*] rabbitmq_web_dispatch             3.5.6
[  ] rabbitmq_web_stomp                3.5.6
[  ] rabbitmq_web_stomp_examples       3.5.6
[  ] sockjs                            0.3.4-rmq3.5.6-git3132eb9
[e*] webmachine                        1.10.3-rmq3.5.6-gite9359c7

Any help would be appreciated

GuillaumeRossolini commented 6 years ago

Never mind, it was indeed a setup issue. I am just using an older version of RabbitMQ (v3.5.6 as shown above) which does not support bert or no_sort. Removing the RABBIT_CAPABILITIES variable fixed the exporter.