-
Notifications
You must be signed in to change notification settings - Fork 858
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
Otel Java agent proxy config #12240
Comments
moving this to the instrumentation repository, since it's agent-specific |
We have this issue too. Sometimes we can't have a local collector in environments and have to traverse a proxy to get to one.
|
Yeah right now it would need to be done with code, using the SPIs (see the ConfigurableSpanExporterProvider and the config PR mentioned above). At least before the spec gets exporter proxy settings, I think an agent extension that configures the exporter for proxy would be a worthy addition to opentelemetry-java-contrib, if you're willing to build and maintain such a thing. |
The agent can be customized via extensions. Extensions can implement the SPIs from https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure-spi and use them to customize the opentelemetry sdk used by the agent. Unfortunately there doesn't seem to be an SPI that would let you easily configure the proxy settings. I guess the |
You can "enhance" the exporter by calling
In terms of making it less painful, declarative configuration is my answer. I would like to see proxy options be part of the OTLP exporter schema in the declarative configuration data model, which would avoid the need for any customization. |
@jack-berg just to clarify do we need the declarative config update for creating a new otel parameter for the java agent? I am not sure if that also includes the agent not being able to connect using the JVM level proxy. We don't see an error message but the env vars aren't picked up. We get a connectivity error even if we start the process as below (bug? agent doesn't read proxy?):
|
@sxjthefirst can you try instead with system properties here https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html? |
Hi everyone, thanks for the responses. @trask - setting proxy with system properties as per https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html seems to work. For those following along, note this is a jvm wide setting. This answers my question but still very keen on something exporter specific such as declarative configuration. Thanks! |
Same as the author but we set proxy and would like it to exempt the specific host like so where we excempt the the namespace the collector is running in from the proxy list: containers:
- env:
- name: HTTP_PROXY
value: http://some.proxy.org:8088/
- name: http_proxy
value: http://some.proxy.org:8088/
- name: HTTPS_PROXY
value: http://some.proxy.org:8088/
- name: https_proxy
value: http://some.proxy.org:8088/
- name: NO_PROXY
value: *.some-namespace
- name: no_proxy
value: *.some-namespace
- name: JAVA_PROXY_OPTIONS
value: -Dhttp.proxyHost=some.proxy.org -Dhttps.proxyHost=some.proxy.org -Dhttp.proxyPort=8088 -Dhttps.proxyPort=8088 -Dhttp.nonProxyHosts=*.some-namespace |
@Starefossen can you try setting I'm not certain whether OkHTTP honors this or not, but it's worth a try. |
@trask |
While java application has no java proxies configured then it works fine, I am able to connect. After adding java proxy settings, it starts to fail with timeouts.
Therefore, I assume, it understands there's proxy configured like Best regards, |
Ok, I know the problem. It depends on handler which reads nonProxyHosts and makes list out of excluded domains patterns. The problem occurs if value of nonProxyHosts is quoted. If my excluded pattern is leading or trailing one, then double quote character becomes part of value and due to that it's not matching.. and let's it think that it should yet go over proxy. Basically,
the very last one makes it different list element not containing double quote :) Actually those situations are mentioned in various softwares. eg while Oracle's documentation gives an example with quotes:
|
Hi Otel community!
Much like open-telemetry/opentelemetry-java#6204, I am trying to export from the otel java agent to an otlp endpoint through a proxy. We are unfortunately unable to use the collector in this instance so we’re looking for a way to configure proxy settings on the java agent.
I note that the feature to enable this has been added in open-telemetry/opentelemetry-java#6270.
I’m not sure if it’s possible but - Can we configure proxy settings for the otlp exporter in the otel java agent by setting for example jvm flags or any other config?
Or at this stage is it only possible by interacting with code/writing an extension as mentioned in open-telemetry/opentelemetry-java#6204 (comment)
I also note the feature request here open-telemetry/opentelemetry-specification#4007 which would be the most ideal solution to our problem.
Thanks!
The text was updated successfully, but these errors were encountered: