vectordotdev / vector

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

`vector` sink proxy disabling #21315

Closed jpds closed 1 month ago

jpds commented 1 month ago

A note for the community

Problem

The vector sink appears to automagically enable HTTP proxy support (with no way of turning it off).

This caused me some issues where I was trying to send data from a locked down network, where on one hand I had a series of targets leveraging the automatic HTTP support (through environment variables), whilst wanting to send to another Vector instance without the HTTP proxy (and down a VPN tunnel instead).

Configuration

No response

Version

0.41.0

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

jszwedko commented 1 month ago

What do you mean by "automagically"? Vector does support the normal http(s)_proxy environment variables. If those are set, the values will be respected. Is that what you mean?

jpds commented 1 month ago

@jszwedko Yes, indeed. In this case, those are useful for the sources I have configured, but I want to disable it just for this one sink.

jszwedko commented 1 month ago

Ah I see. I assume you tried setting: proxy: { enabled: false } on the sink you want to disable it on?

pront commented 1 month ago

~Hmm, this sink is not checking the~ enabled ~field:~ https://github.com/vectordotdev/vector/blob/59b7c9ad55dff61ecc34be71f438e4a7f9826eb8/src/sinks/vector/config.rs#L213

pront commented 1 month ago

Disregard my previous comment, the proxy implementation handles this correctly and doesn't add any proxies if it's disabled. However, enabled is true by default so you will have to manually disable in the global options:

proxy:
  enabled: false