Skip to content

Commit

Permalink
add generic urlparse error
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Cadetg <marco.cadetg@amazee.io>
  • Loading branch information
Marco Cadetg committed Oct 23, 2023
1 parent 7d22e65 commit 20c9214
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
level.Error(logger).Log("msg", "Could not parse target URL", "err", err)
var ue *url.Error
if errors.As(err, &ue) {
probeFailureCounter.WithLabelValues(labelFromUrlError("parse", ue)).Inc()
probeFailureCounter.WithLabelValues(labelFromUrlError("urlparse", ue)).Inc()
} else {
probeFailureCounter.WithLabelValues("urlparse_error").Inc()
}
return false
}
Expand Down Expand Up @@ -507,7 +509,6 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
var hostnameError x509.HostnameError
var certInvalidError x509.CertificateInvalidError
var ue *url.Error

switch {
case errors.As(err, &authorityError):
probeFailureCounter.WithLabelValues("request_certificate_unknown_authority").Inc()
Expand Down

0 comments on commit 20c9214

Please sign in to comment.