Skip to content

Commit

Permalink
Merge pull request #1039 from roidelapluie/update-common
Browse files Browse the repository at this point in the history
Update prometheus/common
  • Loading branch information
roidelapluie authored May 15, 2023
2 parents 2d77e1a + 6b1e25d commit 0dd0455
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
26 changes: 19 additions & 7 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,37 @@ modules:
tls_config:
[ <tls_config> ]

# The HTTP basic authentication credentials for the targets.
# The HTTP basic authentication credentials.
basic_auth:
[ username: <string> ]
[ password: <secret> ]
[ password_file: <filename> ]

# The bearer token for the targets.
[ bearer_token: <secret> ]

# The bearer token file for the targets.
[ bearer_token_file: <filename> ]
# Sets the `Authorization` header on every request with
# the configured credentials.
authorization:
# Sets the authentication type of the request.
[ type: <string> | default: Bearer ]
# Sets the credentials of the request. It is mutually exclusive with
# `credentials_file`.
[ credentials: <secret> ]
# Sets the credentials of the request with the credentials read from the
# configured file. It is mutually exclusive with `credentials`.
[ credentials_file: <filename> ]

# HTTP proxy server to use to connect to the targets.
[ proxy_url: <string> ]
# 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: <string> ]
# Use proxy URL indicated by environment variables (HTTP_PROXY, https_proxy, HTTPs_PROXY, https_proxy, and no_proxy)
[ proxy_from_environment: <bool> | default: false ]
# Specifies headers to send to proxies during CONNECT requests.
[ proxy_connect_headers:
[ <string>: [<secret>, ...] ] ]

# 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: <boolean> | default = false ]

# OAuth 2.0 configuration to use to connect to the targets.
Expand Down
4 changes: 3 additions & 1 deletion blackbox.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
modules:
http_2xx:
prober: http
http:
preferred_ip_protocol: "ip4"
http_post_2xx:
prober: http
http:
Expand Down Expand Up @@ -46,4 +48,4 @@ modules:
prober: icmp
timeout: 5s
icmp:
ttl: 5
ttl: 5
2 changes: 1 addition & 1 deletion prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0dd0455

Please sign in to comment.