Use many blackbox modules in one prometheus job

52 Views Asked by At

I am using blackbox in my prometheus. I defined few modules like:

modules:
  http_2xx_example:
    prober: http
    timeout: 5s
    http:
      valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
      valid_status_codes: []  # Defaults to 2xx
      method: GET
  http_2xx_example_auth:
    prober: http
    timeout: 5s
    http:
      valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
      valid_status_codes: []  # Defaults to 2xx
      method: GET
      basic_auth:
        username: "abc"
        password: "abc"

and then i want to use 2 or more of my modules inside prometheus job:

 - job_name: "blackbox"
    metrics_path: /probe
    params:
      module: [http_2xx_example]
    static_configs:
      - targets:
        - https://google.com
        - https://other_link1
      - targets: [https://other_link2]
        labels:  { __param_module: http_2xx_example_auth }
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: my_fancy_addr

but logs from blackbox exporter shows that my https://other_link2 is probed from http_2xx_example. Why? Is my configuration well? Regards

0

There are 0 best solutions below