Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1585

Prometheus scrape over HTTPS with Haproxy

$
0
0

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 curls and wgets locally and from the Prometheus server. All of them worked as expected. Prometheus' log shows 404. cAdvisor's logs show nothing.


Viewing all articles
Browse latest Browse all 1585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>