Delay init of http phase values (#865)
authorBen Kochie <superq@gmail.com>
Thu, 17 Feb 2022 16:49:37 +0000 (17:49 +0100)
committerGitHub <noreply@github.com>
Thu, 17 Feb 2022 16:49:37 +0000 (17:49 +0100)
commit1b883bf96297b4a621a1e14e1d92e115dd7ec17e
treed542dff263d041931e4702aa17a5d111b6a2ea11
parent4240a3a318a50597cada81b5367fe4756a1b122e
Delay init of http phase values (#865)

Don't init http probe phase labels until we're ready to send the
request.

Avoids exposing 0 value samples for things we haven't started to
measure.

Fix http resolve timing to report lookup time even if it's an error
(ie not found).

Fixes: https://github.com/prometheus/blackbox_exporter/issues/579

Signed-off-by: SuperQ <superq@gmail.com>
prober/http.go