federation using https targets

1,394 views
Skip to first unread message

Mike Michel

unread,
Feb 1, 2016, 6:36:08 AM2/1/16
to Prometheus Developers
hi,

we are running prom behind haproxy which is doing ssl termination. now i want to scrape them with federation.


    target_groups:
      - targets:

returns:
 is not a valid hostname  source=main.go:208

    target_groups:
      - targets:

returns:
server returned HTTP status 400 Bad Request
in the UI because haproxy answers (correct): "You're speaking plain HTTP to an SSL-enabled server port".

haproxy redirects http to https so tried:

    target_groups:
      - targets:

but now in UI: 

dial tcp: too many colons in address ha-prometheus.intern.example.io:80:443



solution?


cheers,

mike

Julius Volz

unread,
Feb 1, 2016, 11:58:07 AM2/1/16
to Mike Michel, Prometheus Developers
Have a look at http://prometheus.io/docs/operating/configuration/#scrape_config. Specifically, you'll want to set the "scheme" in your scrape config to "https". There's also an optional "tls_config" section that allows you to configure things like skipping TLS verification or loading CAs / certs from specific files, if needed.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Michel

unread,
Feb 2, 2016, 1:24:39 PM2/2/16
to Prometheus Developers
cool, works.

thx

Mike Michel

unread,
Feb 2, 2016, 3:42:54 PM2/2/16
to Prometheus Developers
arrr, in live it's not working because of the host header set by prom. it adds the port to the hostname which haproxy does not like and answers with "503 Service Unavailable"


should be:


checking https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 a port should be fine so it seems that sould be fixed in the haproxy.cfg
Reply all
Reply to author
Forward
0 new messages