On Wed, 10 Apr 2024 at 06:47, 'Brian Candler' via Prometheus Users < [email protected]> wrote:
> One exporter scrape = one probe test and I think that should remain. You > can get what you want by expanding the targets (which is a *list* of > targets+labels): > > static_configs: > - targets: > - 1.1.1.1 > - 185.228.168.9 > labels: > queryname: www.google.com > - targets: > - 1.1.1.1 > - 185.228.168.9 > labels: > queryname: www.microsoft.com > Given the targets, I would strongly suggest using DNS names over raw IP addresses for every scrape. Large providers use geo-aware DNS systems, so the IP numbers change over time for a number of reasons (e.g maintenance, capacity turnup/turndown, etc). Probing raw IPs will not reflect the actual state of the service. > On Tuesday 9 April 2024 at 22:48:44 UTC+1 Vincent Romero wrote: > >> Hello, this worked >> >> With the new feature with simple domain works, but considered whether the >> label required adding N domains? >> >> Y try add other domain in the same labels >> >> - job_name: 'blackbox-dns-monitor' >> scrape_interval: 5s >> metrics_path: /probe >> params: >> module: [dns_probe] >> static_configs: >> - targets: >> - 1.1.1.1 #australia cloudflare >> - 185.228.168.9 #ireland >> labels: >> queryname: www.google.com, www.microsoft.com NOT WORK >> queryname: www.microsoft.com NOT WORK (add line) >> >> [image: Captura de pantalla 2024-04-09 a la(s) 17.44.20.png] >> >> El Tuesday, April 9, 2024 a la(s) 12:19:25 PM UTC-4, Vincent Romero >> escribió: >> >>> i will try make build, with this change >>> >>> >>> >>> El Saturday, April 6, 2024 a la(s) 2:45:29 PM UTC-3, Brian Candler >>> escribió: >>> >>>> You're correct that currently the qname is statically configured in the >>>> prober config. >>>> >>>> A patch was submitted to allow what you want, but hasn't been merged: >>>> https://github.com/prometheus/blackbox_exporter/pull/1105 >>>> >>>> You can build blackbox_exporter yourself with this patch applied though. >>>> >>>> On Saturday 6 April 2024 at 18:06:01 UTC+1 Vincent Romero wrote: >>>> >>>>> Helo everyone >>>>> >>>>> what is the difference between http_2xx and dns module configuration >>>>> >>>>> >>>>> I have this example y my config >>>>> >>>>> blackbox.yml >>>>> modules: >>>>> http_2xx: >>>>> prober: http >>>>> http: >>>>> preferred_ip_protocol: "ip4" >>>>> http_post_2xx: >>>>> prober: http >>>>> http: >>>>> method: POST >>>>> www.google.com: >>>>> prober: dns >>>>> timeout: 1s >>>>> dns: >>>>> transport_protocol: "udp" >>>>> preferred_ip_protocol: "ip4" >>>>> query_name: "www.google.com" >>>>> query_type: "A" >>>>> valid_rcodes: >>>>> - NOERROR >>>>> >>>>> prometheus.yml >>>>> - job_name: 'blackbox' >>>>> metrics_path: /probe >>>>> params: >>>>> module: [http_2xx] >>>>> static_configs: >>>>> - targets: >>>>> - https://www.google.com >>>>> relabel_configs: >>>>> - source_labels: [__address__] >>>>> target_label: __param_target >>>>> - source_labels: [__param_target] >>>>> target_label: instance >>>>> - target_label: __address__ >>>>> replacement: localhost:9115 >>>>> >>>>> - job_name: 'blackbox-dns-monitor' >>>>> scrape_interval: 1s >>>>> metrics_path: /probe >>>>> #params: >>>>> #module: [mindfree.cl] >>>>> relabel_configs: >>>>> # Populate domain label with domain portion of __address__ >>>>> - source_labels: [__address__] >>>>> regex: (.*):.*$ >>>>> replacement: $1 >>>>> target_label: domain >>>>> # Populate instance label with dns server IP portion of __address__ >>>>> - source_labels: [__address__] >>>>> regex: .*:(.*)$ >>>>> replacement: $1 >>>>> target_label: instance >>>>> # Populate module URL parameter with domain portion of __address__ >>>>> # This is a parameter passed to the blackbox exporter >>>>> - source_labels: [domain] >>>>> target_label: __param_module >>>>> # Populate target URL parameter with dns server IP >>>>> - source_labels: [instance] >>>>> target_label: __param_target >>>>> # Populate __address__ with the address of the blackbox exporter >>>>> to hit >>>>> - target_label: __address__ >>>>> replacement: localhost:9115 >>>>> >>>>> static_configs: >>>>> - targets: >>>>> - www.google.com:1.1.1.1 #australia cloudflare >>>>> - www.google.com:8.8.8.8 #example other nameserver >>>>> >>>>> >>>>> So, i will try config a simple DNS resolution for any domain >>>>> If i want add other nameserver i need to add other line with the same >>>>> domain >>>>> >>>>> Why whe i used module http_2xx need simple add the target >>>>> >>>>> Thanks >>>>> >>>> -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/74285578-2c0c-48e1-ac85-4ca80cd9bcffn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/74285578-2c0c-48e1-ac85-4ca80cd9bcffn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Conall O'Brien -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAErLiGFvEHbPUdkh72JCV63TwUpBpzMMvRRxwRd8aFERQHVSAg%40mail.gmail.com.

