prometheus cannot access target behind haproxy

143 views
Skip to first unread message

nesa...@gmail.com

unread,
Feb 22, 2021, 2:17:31 AM2/22/21
to Prometheus Users
Hi,
We have a server behind haproxy (service.haproxy.local) and In order to access its metric I can run this curl command and I get the results (the command is executed on the prometheus server):
curl --header "Authorization: Bearer XXXX-XXX-XXX-XXX-XXXX" --request GET 'https://service.haproxy.local/v1/metrics'

and here is the job configuration on the prometheus:

  - job_name: custom_metrics
    scrape_interval: 1m
    scrape_timeout: 30s
    metrics_path: /v1/metrics
    scheme: https
    bearer_token: XXXX-XXX-XXX-XXX-XXXX
    static_configs:
      - targets: 
        - service.haproxy.local:443

But in the prometheus I get 503 service unavailable

Stuart Clark

unread,
Feb 23, 2021, 4:46:27 PM2/23/21
to nesa...@gmail.com, Prometheus Users
What do the HA Proxy logs say when Prometheus requests are made?

--
Stuart Clark

Reply all
Reply to author
Forward
0 new messages