Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support proxy configuration field in all exporters #5761

Closed
cloudnativestack opened this issue Jul 29, 2022 · 8 comments
Closed

Support proxy configuration field in all exporters #5761

cloudnativestack opened this issue Jul 29, 2022 · 8 comments
Assignees
Labels

Comments

@cloudnativestack
Copy link

Is your feature request related to a problem? Please describe.
We have collectors running in hosts within internal network which does not allow outgoing traffic to backends in public internet. A proxy must be used. However, currently OpenTelemetry collector only supports setting a proxy through HTTP[S]_PROXY environment variable, which is extremely unfriendly for collectors running in physical hosts. Only SREs have the privilege to start/stop/restart collectors and it's very hard to inject environment variables to these processes.

Describe the solution you'd like
I would like to field of configuration that can be explicitly set such as:

     some_exporter:
         proxy: example.com:1234

The config can be added to places like https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/exporterhelper

Each exporter should be able have a separate proxy config and should override proxies set by environment variables.

Describe alternatives you've considered
No alternative.

Additional context
Some exporters already support proxy, such as awsxray exporter.

@jpkrohling jpkrohling self-assigned this Aug 24, 2023
@hrittikhere
Copy link
Contributor

@jpkrohling saw your LI post. Would love to work on this with help of your guidance if it's still available 🙌

@jpkrohling
Copy link
Member

Absolutely, ping me on Slack, and I can help you further. But basically, I believe it's just a matter of adding a new config option here:

type HTTPClientSettings struct {

And then add the proxy URL to the transport around here:

You can probably set the Proxy attribute of the transport to this:

https://pkg.go.dev/net/http#ProxyURL

@rvyash
Copy link

rvyash commented Aug 24, 2023

Hey @jpkrohling, I’m interested in this issue. If it has been solved by @hrittikhere thats great 😊. I’m also looking for some good first issues, if you have any recommendations.

@jpkrohling
Copy link
Member

We do have other good first issues in this repository: good first issue Good for newcomers

Feel free to choose one.

dmitryax pushed a commit that referenced this issue Nov 22, 2023
**Description:**
Adding a feature to support proxy configuration field in all exporters

**Link to tracking Issue:**
#5761

---------

Signed-off-by: Hrittik Roy <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
@hrittikhere
Copy link
Contributor

We can close this as fixed @jpkrohling 👀

pantuza pushed a commit to pantuza/opentelemetry-collector that referenced this issue Dec 8, 2023
**Description:**
Adding a feature to support proxy configuration field in all exporters

**Link to tracking Issue:**
open-telemetry#5761

---------

Signed-off-by: Hrittik Roy <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
@loicdescotte
Copy link

Hi, It seems there is no documentation about this setting usage

@jpkrohling
Copy link
Member

@loicdescotte, would you mind opening a PR, and perhaps another issue? Basically, one can set proxy_url on any exporters using the confighttp's HTTPClientSettings, like OTLP Exporter. It's to be set at the same level as the endpoint property, and follows the semantics of https://pkg.go.dev/net/http#ProxyURL

@loicdescotte
Copy link

Hi, I can't open a PR as I won't be able to test it, because I am using AWS Distro for OTEL, that is not using the same semantics for the proxy. I can't open an issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants