openshift-prometheus icon indicating copy to clipboard operation
openshift-prometheus copied to clipboard

haproxy metrics not working

Open goposky opened this issue 8 years ago • 3 comments

Hi, Thanks for this very useful setup. However, I wasnt able to get haproxy metrics directly by following this document. Prometheus is unable to scrap the metrics url and I see the below error: level=warn ts=2017-12-28T12:49:06.486711654Z caller=scrape.go:673 component="target manager" scrape_pool=openshift-routers target=http://router-ota.default.svc.cluster.local:1936/metrics msg ="append failed" err="no token found" PS: The official prometheus document suggests we must use the haproxy_exporter (https://prometheus.io/docs/instrumenting/exporters/).

goposky avatar Dec 28 '17 13:12 goposky

Are you looking at the “right” scrape? Prometheus also auto discovers the router but can not scrape it because it’s missing the authentication. You can see that under /targets. There is a second entry for the router at the bottom.

wkulhanek avatar Dec 28 '17 13:12 wkulhanek

Yes, if you mean the following stanza I do have it.

`- job_name: 'openshift-routers' metrics_path: '/metrics' scheme: http basic_auth: username: admin password: ********* static_configs:

  • targets: ['router-ota.default.svc.cluster.local:1936']`

goposky avatar Dec 28 '17 14:12 goposky

I'm having the same problem. Have you been able to solve this @goposky? I've checked that the authentication is working properly by hitting the target using curl + user/pwd from prometheus pod.

openshift v3.5.5.31.67
kubernetes v1.5.2+43a9be4

charlysan avatar Oct 30 '18 19:10 charlysan