Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

probe_ip_addr_hash is not changed in dns prober #875

Closed
hillbun opened this issue Jan 27, 2022 · 5 comments
Closed

probe_ip_addr_hash is not changed in dns prober #875

hillbun opened this issue Jan 27, 2022 · 5 comments

Comments

@hillbun
Copy link

hillbun commented Jan 27, 2022

Host operating system: output of uname -a

Linux node1 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

blackbox_exporter version: output of blackbox_exporter --version

blackbox_exporter, version 0.19.0 (branch: HEAD, revision: 5d575b8)
build user: root@2b0258d5a55a
build date: 20210510-12:56:44
go version: go1.16.4
platform: linux/amd64

What is the blackbox.yml module config.

dns_test1:
prober: dns
timeout: 5s
dns:
query_name: "test1.xxx.com"
query_type: "A"
valid_rcodes:
- NOERROR

What is the prometheus.yml scrape config.

  • job_name: 'blackbox-dns-test1'
    metrics_path: /probe
    params:
    module: [dns_test1]
    static_configs:
    • targets:
      • 12.34.56.78
        relabel_configs:
    • source_labels: [address]
      target_label: __param_target
    • source_labels: [__param_target]
      target_label: instance
    • target_label: address
      replacement: 1.2.3.4:9115

What logging output did you get from adding &debug=true to the probe URL?

curl "1.2.3.4:9115/probe?module=dns_test1&target=12.34.56.78&&debug=true"
Logs for the probe:
ts=2022-01-27T09:27:48.237763964Z caller=main.go:320 module=dns_test1 target=12.34.56.78 level=info msg="Beginning probe" probe=dns timeout_seconds=5
ts=2022-01-27T09:27:48.238059891Z caller=dns.go:195 module=dns_test1 target=12.34.56.78 level=info msg="Resolving target address" ip_protocol=ip6
ts=2022-01-27T09:27:48.238124206Z caller=dns.go:195 module=dns_test1 target=12.34.56.78 level=info msg="Resolving target address" ip_protocol=ip4
ts=2022-01-27T09:27:48.23817272Z caller=dns.go:195 module=dns_test1 target=12.34.56.78 level=info msg="Resolved target address" ip=12.34.56.78
ts=2022-01-27T09:27:48.238256811Z caller=main.go:130 module=dns_test1 target=12.34.56.78 level=info msg="Making DNS query" target=12.34.56.78:53 dial_protocol=udp4 query=test1.xxx.com type=1 class=1
ts=2022-01-27T09:27:48.239203899Z caller=main.go:130 module=dns_test1 target=12.34.56.78 level=info msg="Got response" response=";; opcode: QUERY, status: NOERROR, id: 37799\n;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0\n\n;; QUESTION SECTION:\n;test1.xxx.com.\tIN\t A\n\n;; ANSWER SECTION:\ntest1.xxx.com.\t36\tIN\tA\t103.106.208.5\n"
ts=2022-01-27T09:27:48.239326977Z caller=dns.go:292 module=dns_test1 target=12.34.56.78 level=info msg="Rcode is valid" rcode=0 string_rcode=NOERROR
ts=2022-01-27T09:27:48.239382811Z caller=main.go:130 module=dns_test1 target=12.34.56.78 level=info msg="Validating Answer RRs"
ts=2022-01-27T09:27:48.239483169Z caller=dns.go:296 module=dns_test1 target=12.34.56.78 level=info msg="Validating RR" rr="test1.xxx.com.\t36\tIN\tA\t103.106.208.5"
ts=2022-01-27T09:27:48.23954682Z caller=main.go:130 module=dns_test1 target=12.34.56.78 level=info msg="Validating Authority RRs"
ts=2022-01-27T09:27:48.239589233Z caller=main.go:130 module=dns_test1 target=12.34.56.78 level=info msg="Validating Additional RRs"
ts=2022-01-27T09:27:48.239637943Z caller=main.go:320 module=dns_test1 target=12.34.56.78 level=info msg="Probe succeeded" duration_seconds=0.001761885



Metrics that would have been returned:
# HELP probe_dns_additional_rrs Returns number of entries in the additional resource record list
# TYPE probe_dns_additional_rrs gauge
probe_dns_additional_rrs 0
# HELP probe_dns_answer_rrs Returns number of entries in the answer resource record list
# TYPE probe_dns_answer_rrs gauge
probe_dns_answer_rrs 1
# HELP probe_dns_authority_rrs Returns number of entries in the authority resource record list
# TYPE probe_dns_authority_rrs gauge
probe_dns_authority_rrs 0
# HELP probe_dns_duration_seconds Duration of DNS request by phase
# TYPE probe_dns_duration_seconds gauge
probe_dns_duration_seconds{phase="connect"} 0.000309708
probe_dns_duration_seconds{phase="request"} 0.000563098
probe_dns_duration_seconds{phase="resolve"} 0.000159811
# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 0.000159811
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 0.001761885
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 1.761043098e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_success Displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 1



Module configuration:
prober: dns
timeout: 5s
http:
    ip_protocol_fallback: true
    follow_redirects: true
tcp:
    ip_protocol_fallback: true
icmp:
    ip_protocol_fallback: true
dns:
    ip_protocol_fallback: true
    query_name: test1.xxx.com
    query_type: A
    valid_rcodes:
        - NOERROR

What did you do that produced an error?

probe_ip_addr_hash always return value of 1.761043098e+09 when IP address changed

What did you expect to see?

probe_ip_addr_hash should return different value when IP address changed

What did you see instead?

@SuperQ
Copy link
Member

SuperQ commented Jan 27, 2022

This is probably fixed by #863, which will be in the next release.

@dgl
Copy link
Member

dgl commented Jan 27, 2022

Note probe_ip_addr_hash is the hash of the DNS server used, not the result of query. i.e. in this example it is the hash of 12.34.56.78. Use validate_answer_rrs to check the results of the query.

@hillbun
Copy link
Author

hillbun commented Jan 30, 2022

@dgl @SuperQ

How to config and monitor with validate_answer_rrs or probe_ip_addr_hash in my sample?

when domain of test1.xxx.com resolve IP or IPs changed.

please advice. thanks

@hillbun
Copy link
Author

hillbun commented Feb 11, 2022

@dgl @SuperQ

any advice to monitor IP resolved changed? thanks,

@SuperQ
Copy link
Member

SuperQ commented Feb 21, 2022

Use a normal http, icmp, or tcp probe.

@SuperQ SuperQ closed this as completed Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants