I have a Prometheus instance running locally, trying to scrape metrics from cAdvisor through HAPproxy.The Prometheus job:
- job_name: cadvisor_server scheme: https static_configs: - targets: [ 'n1-cadvisor.proxy.cl:443' ] tls_config: ca_file: /etc/prometheus/ca-bundle.crt
The HAProxy configuration (backend):
backend n1_monitoring http-response set-header Access-Control-Allow-Origin "*" http-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorisation, JSNLog-RequestId, activityId, activeId, applicationId, applicationUserId, channelId, senderId, sessionId" http-response set-header Access-Control-Max-Age 3628800 http-response set-header Access-Control-Allow-Methods "GET" option httpchk GET /metrics http-check expect ! rstatus ^[4-5] server n1 n1.localdomain:8087
HAProxy stats show the backend as operational, when I connect via browser I see metrics. When I curl from my computer I see metrics. When I curl from inside the Prometheus container I see metrics. When I replaced the proxy address with the host and port in Prometheus' targets, I get metrics.
But when I use Prometheus to query I see server returned HTTP status 404 not found
, and on HAProxy I see the log proxy.cl~ nomatch/<NOSRV>
along with 404.I'd appreciate any help!
I tried curl
s and wget
s locally and from the Prometheus server. All of them worked as expected. Prometheus' log shows 404. cAdvisor's logs show nothing.