4

What is the semantics of a job for a Prometheus blackbox exporter that cites more than one module under params.module?

I guess it means that all modules are tried and the probe only succeeds if all of them succeed. All the examples I have come across employ only single modules (typically module: [http_2xx]), and I have not configured an example nor looked it up in the source code so far. Maybe someone here knows already/definitely from direct experience.

rookie099
  • 2,201
  • 2
  • 26
  • 52

1 Answers1

4

Based on the blackbox_exporter source code it would seem that every probe only ever executes a single test / module. Either you provide the module name in the request (as suggested by the documentation) or else it defaults to http_2xx.

The only way you could execute multiple modules would appear to be to define a separate Prometheus job, with a different module parameter value.

The only reason Prometheus' params is an array rather than a single value is that it's not limited to blackbox_exporter, it's a general way of sending HTTP parameters to a target (e.g. one might use something like /metrics?module=foo&module=bar to instruct the target to only return metrics for modules foo and bar).

I just tested from the browser and what happens if you query blackbox_exporter with multiple module parameter values, is that blackbox_exporter will ignore everything but the first value.

Alin Sînpălean
  • 8,774
  • 1
  • 25
  • 29
  • Yes, that makes sense: "The only reason Prometheus' `params` is an array rather than a single value is that it's not limited to `blackbox_exporter`..." – rookie099 Nov 15 '19 at 11:17