I am trying to use Metricbeat’s Prometheus module to collect results from the Blackbox Exporter (prom/blackbox-exporter), which probes services using the /probe endpoint.
I want to probe internal service health endpoints (e.g., /health) using Blackbox and then collect the resulting metrics (probe_success, probe_duration_seconds, etc.) using Metricbeat, and send them to Elasticsearch.
In Prometheus, we added the following scrape config:
scrape_configs:
- job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx]
static_configs:- targets:
- source_labels: [address]
target_label: __param_target - source_labels: [__param_target]
target_label: instance - target_label: address
replacement: blackbox-exporter.namespace.svc:9115
This setup worked perfectly.
But now I want to scrape the metrics using Metricbeat instead of Prometheus.
I tried to configure Metricbeat’s prometheus module like this:
metricbeat.modules:
- module: prometheus
metricsets: ["collector"]
period: 30s
hosts:- "http://blackbox-exporter.namespace.svc:9115"
metrics_path: /probe
params:
module: ["http_2xx"]
target: ["http://service-a.namespace.svc:8080/health"]
- "http://blackbox-exporter.namespace.svc:9115"
Actual behavior: Metricbeat either:
- Ignores the
params:field entirely (query string not included in the request) - Fails with errors or timeouts (as it tries to scrape
/probewithout requiredtargetparam)
Any suggestions?