No: you can set __param_module differently for targets in the same job.
A simple way is to use the file_sd file to add labels to groups of targets (each group can be a single target):
- labels:
module: mod1
targets:
- labels:
module: mod2
targets:
#... etc
And a simple relabel config:
relabel_configs:
- source_labels: [module]
target_label: __param_module
(Note: you *could* just set the __param_module label directly in the targets file. However this is dangerous if you ever probe the same host with two different blackbox modules; you need some stored distinguishing label to keep the timeseries separate. In any case, the label giving the probe module used is useful for history and dashboards)
If the above targets config is still too verbose for you, then you can used something like this:
with some more sophisticated relabeling (untested):
relabel_configs:
# Split "foo;bar" into instance="foo" module="bar"
- source_labels: [__address__]
regex: '(.+);(.+)'
target_label: instance
replacement: '${1}'
- source_labels: [__address__]
regex: '(.+);(.+)'
target_label: module
replacement: '${2}'
# Fallback: bare "foo" becomes instance="foo" module="some_default"
- source_labels: [__address__]
regex: '([^;]+)'
target_label: instance
replacement: '${1}'
- source_labels: [__address__]
regex: '([^;]+)'
target_label: module
replacement: 'icmp'
# copy instance to __param_target and module to __param_module
- source_labels: [instance]
target_label: __param_target
- source_labels: [module]
target_label: __param_module
# send scrape to blackbox_exporter
- target_label: __address__
HTH, Brian.