rabbitmq / rabbitmq-prometheus

A minimalistic Prometheus exporter of core RabbitMQ metrics
Other
145 stars 109 forks source link

Failed to retrieve metrics when Accept header specifies extension #13

Closed rjbaucells closed 4 years ago

rjbaucells commented 4 years ago

RabbitMQ prometheus endpoint returns status code 406 when request Accept header specifies additional parameters (version):

curl -v -s http://localhost:15692/metrics -H "Accept: text/plain;version=0.0.4" > /dev/null

* TCP_NODELAY set
> GET /metrics HTTP/1.1
> Host: localhost:15692
> User-Agent: curl/7.54.0
> Accept: text/plain;version=0.0.4
> 
< HTTP/1.1 406 Not Acceptable
< content-length: 0
< date: Thu, 24 Oct 2019 14:21:53 GMT
< server: Cowboy
< 
...

Other Accept parameters are processed by the prometheus endpoint without problems (including multiple values):

curl -v -s http://localhost:15692/metrics -H "Accept: */*,text/plain;q=0.9" > /dev/null

* TCP_NODELAY set
> GET /metrics HTTP/1.1
> Host: localhost:15692
> User-Agent: curl/7.54.0
> Accept: */*,text/plain;q=0.9
> 
< HTTP/1.1 200 OK
< content-encoding: identity
< content-length: 1443970
< content-type: text/plain; version=0.0.4
< date: Thu, 24 Oct 2019 14:26:18 GMT
< server: Cowboy
< 
{ [1080 bytes data]
...
michaelklishin commented 4 years ago

Duplicate of #12.