- job_name: 'blackbox'
metrics_path: /probe
file_sd_configs:
- files:
- '/etc/prometheus/blackbox/targets/*.yml'
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __param_target
- source_labels: [module]
target_label: __param_module
- target_label: __address__
replacement: localhost:9115 # The blackbox exporter
My blackbox.yml:
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_status_codes: []
method: GET
no_follow_redirects: false
fail_if_ssl: false
fail_if_not_ssl: true
preferred_ip_protocol: "ip4"
ip_protocol_fallback: false
http_basic_auth:
prober: http
timeout: 5s
http:
method: POST
basic_auth:
username: "username"
password: "password"
And my targets config:
http_2xx.yml
- labels:
module: http_2xx
targets:
http_basic_auth.yml
- labels:
module: http_basic_auth
targets:
Prometheus discovers correctly the 2 targets but I have an error for the second one "server returned HTTP status 400 Bad Request" and in probe curl : "Unknown module http_basic_auth".
Any idea?