blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

Probe using proxy_url and skip_resolve_phase_with_proxy doesn't work as wanted

Open AlexanderKocheshkov opened this issue 7 months ago • 0 comments

Host operating system: output of uname -a

CentOS Stream 9

blackbox_exporter version: output of blackbox_exporter --version

blackbox_exporter, version 0.24.0 (branch: HEAD, revision: 0b0467473916fd9e8526e2635c2a0b1c56011dff)

What is the blackbox.yml module config.

http:
        http:
          proxy_url: "someurl"
          skip_resolve_phase_with_proxy
          preferred_ip_protocol: ip4
          tls_config:
            insecure_skip_verify: true
        prober: http
        timeout: 10s

What is the prometheus.yml scrape config.

- job_name: probe/blackbox-exporter
  honor_timestamps: true
  params:
    module:
    - http
  scrape_interval: 30s
  scrape_timeout: 10s
  metrics_path: /probe
  scheme: http
  follow_redirects: true
  relabel_configs:
  - source_labels: [job]
    separator: ;
    regex: (.*)
    target_label: __tmp_prometheus_job_name
    replacement: $1
    action: replace
  - source_labels: [__address__]
    separator: ;
    regex: (.*)
    target_label: __param_target
    replacement: $1
    action: replace
  - source_labels: [__param_target]
    separator: ;
    regex: (.*)
    target_label: instance
    replacement: $1
    action: replace
  - separator: ;
    regex: (.*)
    target_label: __address__
    replacement: blackbox-exporter:9115
    action: replace
  static_configs:
  - targets:
    - https://google.com/

What logging output did you get from adding &debug=true to the probe URL?

ts=2023-11-20T10:40:57.843171898Z caller=main.go:181 module=http target=https://google.com/ level=info msg="Beginning probe" probe=http timeout_seconds=10 ts=2023-11-20T10:40:57.843299518Z caller=client.go:252 module=http target=https://google.com/ level=info msg="Making HTTP request" url=https://google.com/ host=google.com ts=2023-11-20T10:40:57.843490603Z caller=handler.go:120 module=http target=https://google.com/ level=error msg="Error for HTTP request" err="Get "https://google.com/": proxyconnect tcp: dial tcp :0: connect: connection refused" ts=2023-11-20T10:40:57.843511722Z caller=handler.go:120 module=http_internet target=https://google.com/ level=info msg="Response timings for roundtrip" roundtrip=0 start=2023-11-20T10:40:57.843369793Z dnsDone=2023-11-20T10:40:57.843369793Z connectDone=2023-11-20T10:40:57.843476007Z gotConn=0001-01-01T00:00:00Z responseStart=0001-01-01T00:00:00Z tlsStart=0001-01-01T00:00:00Z tlsDone=0001-01-01T00:00:00Z end=0001-01-01T00:00:00Z ts=2023-11-20T10:40:57.843541977Z caller=main.go:181 module=http target=https://google.com/ level=error msg="Probe failed" duration_seconds=0.000332782

What did you do that produced an error?

Added a module that uses a proxy with skip_resolve_phase_with_proxy: true

What did you expect to see?

Successful probe

What did you see instead?

Failed probe

Detailed:

  1. I verified that the proxy works fine using network-multitool;
  2. I have configured a blackbox with a module that uses proxy and name resolving via 8.8.8.8;
  3. I ran a series of tests with different configurations;
  4. I used Wireshark+ksniff and Irealized that blackbox went to 127.0.0.1.

AlexanderKocheshkov avatar Nov 20 '23 12:11 AlexanderKocheshkov