I'm currently evaluating the blackbox exporter.
My docker-compose.yml looks like:
```
version: "3"
services:
prometheus:
image: prom/prometheus
restart: unless-stopped
volumes:
- "$PWD/shared/prometheus/etc/prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
blackbox:
image: prom/blackbox-exporter:master
restart: unless-stopped
volumes:
- "$PWD/shared/blackbox/config:/config"
ports:
- 9115:9115
command:
- --config.file=/config/blackbox.yml
```
The prometheus configuration looks like:
```
global:
# How frequently to scrape targets
scrape_interval: 10s
# How frequently to evaluate rules
evaluation_interval: 10s
scrape_configs:
- job_name: "blackbox"
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets:
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115 # The blackbox exporter's real hostname:port.
```
The stack can be brought up correctly.
When accessing the blackbox exporter from my machine, it works as expected:
However, prometheus is unable to reach blackbox exporter: server returned HTTP status 400 Bad Request
When I connect into the prometheus container, I can check that the port 9115 is correctly open and that blackbox is reachable:
```
$ nc -nv blackbox 9115
```
Connections to the blackbox main page works fine:
```
saving to 'index.html'
index.html 100% |************************************************| 651 0:00:00 ETA
'index.html' saved
```
But connecting to the /probe fails:
```
This is a shell quoting issue, put quotes around the URL.