vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
17.57k stars 1.54k forks source link

Proxy not Lookup on Proxt but still non Proxied DNS #18905

Open DwiyanTech opened 11 months ago

DwiyanTech commented 11 months ago

A note for the community

Problem

have a problem when I'm connected to a proxy. The vector performs address lookup on the internal DNS resolver, not the proxy, causing the request to fail because it doesn't resolve the DNS. Please fix it so that the DNS resolver follows the proxy, like most applications do (i'm test with filebeat with proxy it's connect but i want use vector to seperate files that featruee filebeat doesn't have

Configuration

[sources.gcp_dev]
type = "gcp_pubsub"
credentials_path = "REDACTED"
project = "REDACTED"
subscription = "REDACTED"
proxy.enabled = true
proxy.http = "http://PROXY_SERVER"
proxy.https = "http://PROXY_SERVER"

[transforms.remap_to_json_line]
type = "remap"
inputs = [ "gcp_dev" ]
source = ". = parse_json!(.message)"

[sinks.output_to_file]
type = "console"
inputs = [ "remap_to_json_line" ]
target = "stdout"

  [sinks.output_to_file.encoding]
  codec = "json"

Version

Vector 0.26.0

Debug Output

2023-10-21T22:16:12.812918Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:12.812961Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:13.813488Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:14.155952Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004435597065384209
2023-10-21T22:16:18.819107Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:18.819150Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:19.155573Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.000000049979043479548845
2023-10-21T22:16:19.824047Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:24.156058Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004837369980339079
2023-10-21T22:16:24.832155Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:24.832207Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:25.833404Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:29.155396Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000010151023849067816
2023-10-21T22:16:30.840963Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:30.841012Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:31.842881Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:34.155832Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004848765621769742
2023-10-21T22:16:36.851256Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:36.851298Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:37.852820Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:39.155351Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004823294427134452
2023-10-21T22:16:42.858162Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:42.858208Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:43.860915Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:44.156060Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004135810460431453
2023-10-21T22:16:48.869686Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:48.869732Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:49.155228Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004914330918836509
2023-10-21T22:16:49.870807Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:54.155586Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004181168509084175
2023-10-21T22:16:54.878194Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:16:54.878240Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:16:55.879739Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:16:59.155455Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.00000004684230033624387
2023-10-21T22:17:00.885204Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:17:00.885255Z  INFO vector::sources::gcp_pubsub: Retrying after timeout. timeout_secs=1.0
2023-10-21T22:17:01.886783Z DEBUG hyper::client::connect::dns: resolving host="pubsub.googleapis.com"
2023-10-21T22:17:04.156189Z DEBUG sink{component_kind="sink" component_id=output_to_file component_type=console component_name=output_to_file}: vector::utilization: utilization=0.0000000455382201245299
2023-10-21T22:17:06.893919Z ERROR vector::internal_events::gcp_pubsub: Failed to connect to the server. error=transport error error_code="failed_connecting" error_type="connection_failed" stage="receiving" internal_log_rate_limit=true
2023-10-21T22:17:06.893983Z  INFO vector::sources::gcp_pubsub: Retrying

Example Data

Screen Shot 2023-10-22 at 05 18 18

Additional Context

No response

References

No response

garnaud commented 2 months ago

We've got same kind of errors. The first request to oauth2.googleapis.com works, but then request to pubsub.googleapis.com fails because of a timeout with a public IP of pubsub.googleapis.com instead of using proxy connection.

jszwedko commented 2 months ago

I'm a little confused. The HTTP proxy settings are just for proxying HTTP requests, not changing where DNS requests are sent. Is it the cas that your HTTP proxy is also acting as a DNS server?