Expose probe_dns_duration_seconds metric (#662)
authorMarcelo Magallon <marcelo.magallon@gmail.com>
Mon, 13 Jul 2020 10:30:52 +0000 (04:30 -0600)
committerGitHub <noreply@github.com>
Mon, 13 Jul 2020 10:30:52 +0000 (11:30 +0100)
commit55c667ab4ce5bdd81ebf8b843851222aa1f7fab3
tree868c1607d80632d52c3f6c345f8de98792cfb54d
parent63678419a6a274ac6d43d3d4088cad2a1d06371f
Expose probe_dns_duration_seconds metric (#662)

* Expose probe_dns_duration_seconds metric

This follows the same pattern as probe_http_duration_seconds and
probe_icmp_duration_seconds: it captures the time it takes to perform
the actual request, excluding the time it takes to set up things.
probe_duration_seconds includes the time to perform the request as well
as all the time it takes to set it up. probe_dns_lookup_time_seconds
refers to the time it takes to resolve the target's address, so it
doesn't capture the time it takes to make one request for that target.

Follow probe_http_duration_seconds and add a "phase" label to
probe_dns_duration_seconds, which splits the time it takes to complete
the check into "resolve" (time to resolve the target name), "connect"
(time to connect to the DNS server) and "request" (time to send the
query and retrieve the response).

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
prober/dns.go
prober/dns_test.go
prober/http_test.go
prober/utils_test.go