From: Julien Pivotto Date: Thu, 9 Mar 2023 22:47:53 +0000 (+0100) Subject: Update prometheus/common X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6b1e25d8752c1db52fb38906eaf6002d47ec7a3c;p=blackbox_exporter.git Update prometheus/common Signed-off-by: Julien Pivotto --- diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 604ee89..7eb3698 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -109,25 +109,37 @@ modules: tls_config: [ ] - # The HTTP basic authentication credentials for the targets. + # The HTTP basic authentication credentials. basic_auth: [ username: ] [ password: ] [ password_file: ] - # The bearer token for the targets. - [ bearer_token: ] - - # The bearer token file for the targets. - [ bearer_token_file: ] + # Sets the `Authorization` header on every request with + # the configured credentials. + authorization: + # Sets the authentication type of the request. + [ type: | default: Bearer ] + # Sets the credentials of the request. It is mutually exclusive with + # `credentials_file`. + [ credentials: ] + # Sets the credentials of the request with the credentials read from the + # configured file. It is mutually exclusive with `credentials`. + [ credentials_file: ] # HTTP proxy server to use to connect to the targets. [ proxy_url: ] + # Comma-separated string that can contain IPs, CIDR notation, domain names + # that should be excluded from proxying. IP and domain names can + # contain port numbers. + [ no_proxy: ] + # Use proxy URL indicated by environment variables (HTTP_PROXY, https_proxy, HTTPs_PROXY, https_proxy, and no_proxy) + [ proxy_from_environment: | default: false ] # Specifies headers to send to proxies during CONNECT requests. [ proxy_connect_headers: [ : [, ...] ] ] - # Skip DNS resolution and URL change when an HTTP proxy (proxy_url) is set. + # Skip DNS resolution and URL change when an HTTP proxy (proxy_url or proxy_from_environment) is set. [ skip_resolve_phase_with_proxy: | default = false ] # OAuth 2.0 configuration to use to connect to the targets. diff --git a/blackbox.yml b/blackbox.yml index 62884bc..1ad0c81 100644 --- a/blackbox.yml +++ b/blackbox.yml @@ -1,6 +1,8 @@ modules: http_2xx: prober: http + http: + preferred_ip_protocol: "ip4" http_post_2xx: prober: http http: @@ -46,4 +48,4 @@ modules: prober: icmp timeout: 5s icmp: - ttl: 5 \ No newline at end of file + ttl: 5 diff --git a/prober/http.go b/prober/http.go index 5e452cd..441edc4 100644 --- a/prober/http.go +++ b/prober/http.go @@ -323,7 +323,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr targetPort := targetURL.Port() var ip *net.IPAddr - if !module.HTTP.SkipResolvePhaseWithProxy || module.HTTP.HTTPClientConfig.ProxyURL.URL == nil { + if !module.HTTP.SkipResolvePhaseWithProxy || module.HTTP.HTTPClientConfig.ProxyConfig.ProxyURL.URL == nil || module.HTTP.HTTPClientConfig.ProxyConfig.ProxyFromEnvironment { var lookupTime float64 ip, lookupTime, err = chooseProtocol(ctx, module.HTTP.IPProtocol, module.HTTP.IPProtocolFallback, targetHost, registry, logger) durationGaugeVec.WithLabelValues("resolve").Add(lookupTime)