To see the labels which blackbox_exporter adds, just use curl:
Remember that prometheus itself adds "job" and "instance" labels. And of course, you can just do a PromQL query in the web UI to see the full set of labels:
However, there's no need to "rename" an existing label, when you can add your own. At simplest:
labels:
foo: bar
- targets:
Now, you're actually interested in knowing which module was used. The config you've written with
params:
module:
- http_proxy_1
- http_proxy_2
won't work anyway, as far as I know. This will set ...&module=http_proxy_1&module=http_proxy_2 but blackbox_exporter will only look at the first one seen (as you can see if you test this with curl).
So you need to scrape each target twice. One way is to have two jobs, one for module=http_proxy_1 and one for module=http_proxy_2. This means you can share the same targets file between the jobs. The metrics will be distinguished by the "job" label, and/or you can set some other label in rewriting rules:
- target_label: module
replacement:
http_proxy_1 # or http_proxy_2 in the other job
The other way to do it is to set the "module" within the targets file, and list the targets multiple times. This is based on my own running config:
- job_name: blackbox
file_sd_configs:
- files:
- /etc/prometheus/blackbox.d/*.yml
metrics_path: /probe
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: 127.0.0.1:9115 # Blackbox exporter
Then in the targets file:
- labels:
module: http_proxy_1
- labels:
module: http_proxy_2
This gives you the maximum flexibility, since with a single scrape job you can scrape whatever blackbox modules you like, just by adding targets.