prometheus / blackbox_exporter

Blackbox prober exporter
https://prometheus.io
Apache License 2.0
4.65k stars 1.05k forks source link

Feature request: DNS probes should return enough metrics to tell servers that don't answer from servers that refuse our query #474

Closed siebenmann closed 1 year ago

siebenmann commented 5 years ago

Right now, DNS probes do not return enough information to tell the difference between a DNS server not responding at all and a DNS server that responds with query refusals (eg status REFUSED). These are potentially fairly different failures, especially if you're querying an external DNS server to verify that it can resolve your domains, and it would be nice if you could tell the difference through the blackbox exporter.

Perhaps the easiest feature addition would be to expose a probe_dns_rcode metric and give it a value of -1 if the probe received no response.

brian-brazil commented 5 years ago

Wouldn't probe_dns_answer_rrs and whether the probe succeeded cover this?

siebenmann commented 5 years ago

Unfortunately they don't, at least currently. If the probe fails because of either a REFUSED return code from the server or because the server does not respond, probe success is 0 and probe_dns_answer_rrs and the other _rrs metrics are 0, so you can't tell the two cases apart. Perhaps the probe_dns rrs metrics should have some other value if there's no reply at all, but 0 still feels natural in that case and I think it would be better to have a different metric to be explicit.

(If the server is down, you can try to look at the probe duration to guess if there was a timeout. But if the server is up but rejecting UDP DNS packets, for example because it's not currently running a DNS server, the probe duration is still short.)

candlerb commented 5 years ago

Being able to set or clear RD in requests would be useful too (for correctly testing recursive and authoritative servers)

akshatgit commented 5 years ago

If nobody is working on this, I'd like to contribute to this issue.