Blackbox are not recognizing another modules than not is http_2xx

74 views
Skip to first unread message

Ricardo Estalder

unread,
Mar 6, 2020, 9:05:11 AM3/6/20
to Prometheus Users

Hello
I have the following issue with blackbox exporter module
Currently the blackbox are not recognized another module that no is http_2xx
These are my config files

prometheus.yml

  - job_name: 'blackbox'
    metrics_path: /probe
    file_sd_configs:
      - files:
          - '/etc/prometheus/blackbox/targets/*.yml'
    relabel_configs:
      - source_labels: [__address__]
        separator: ;
        regex: (.*)
        target_label: __param_target
        replacement: $1
        action: replace
      - source_labels: [__param_target]
        separator: ;
        regex: (.*)
        target_label: instance
        replacement: $1
        action: replace
      - target_label: __address__
        replacement: prometheus.edgelan:9115 # The blackbox exporter
        action: replace

Blackbox

config.yml

   modules:
      https_2xx:
        prober: http
        timeout: 5s
        http:
          method: GET
          no_follow_redirects: false
          fail_if_ssl: false
          fail_if_not_ssl: true
          preferred_ip_protocol: "ipv4"
      http_2xx:
        prober: http
        timeout: 5s
        http:
          method: GET
          no_follow_redirects: false
          fail_if_ssl: true
          fail_if_not_ssl: false
          preferred_ip_protocol: "ipv4"

#Target config files

http_2xx.yml

- labels:
    module: http_2xx
  targets:
  - http://www.stealmylogin.com/

https_2xx.yml

- labels:
    module: https_2xx
  targets:
  - https://www.sethryder.com
  - https://www.modpackindex.com

On the logs of the probe only matches with module http_2xx but no the module https_2xx or another modules present on the config file
When i delete all the modules and only set the module https_2xx the probe logs show Unknown module "http_2xx" that means what I said before, blackbox is not recognize another modules that no is http_2xx

Brian Candler

unread,
Mar 6, 2020, 1:40:07 PM3/6/20
to Prometheus Users
In your relabeling, you also need to copy label "module" to "__param_module" (otherwise it won't get sent to the exporter)

Ricardo Estalder

unread,
Mar 6, 2020, 1:56:08 PM3/6/20
to Brian Candler, Prometheus Users
Thank now it works !

    relabel_configs:
      - source_labels: [module]
        target_label: __param_module
      - source_labels: [module, __address__]

        target_label: __param_target
        replacement: $1
        action: replace
      - source_labels: [__address__]
        separator: ;
        regex: (.*)
        target_label: __param_target
        replacement: $1
        action: replace
      - source_labels: [__param_target]
        separator: ;
        regex: (.*)
        target_label: instance
        replacement: $1
        action: replace
      - target_label: __address__
        replacement: prometheus.edgelan:9115 # The blackbox exporter
        action: replace
El vie., 6 mar. 2020 a las 15:40, Brian Candler (<b.ca...@pobox.com>) escribió:
In your relabeling, you also need to copy label "module" to "__param_module" (otherwise it won't get sent to the exporter)

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9b7d65ed-9a78-4517-8ebc-f551c8e2183f%40googlegroups.com.

Brian Candler

unread,
Mar 6, 2020, 2:21:32 PM3/6/20
to Prometheus Users
On Friday, 6 March 2020 18:56:08 UTC, Ricardo Estalder wrote:
      - source_labels: [module, __address__]
        target_label: __param_target
        replacement: $1
        action: replace

Not sure what's going on: there's no need to join labels together, and then later on you replace __param_target anyway.

It should simplify down to:

    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [module]
        target_label: __param_module

Ricardo Estalder

unread,
Mar 6, 2020, 2:52:04 PM3/6/20
to Brian Candler, Prometheus Users
thanks for your help I newbie on prometheus app and i don't known many things

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages