Add proxy_address to OTLP Exporter#2167
Conversation
This allows more fine-graned control over proxy configurations of various exporters. Fixes open-telemetry#2166
|
|
I will hopefully get IBM's CLA linked to my account shortly. |
thompson-tomo
left a comment
There was a problem hiding this comment.
Thanks for the suggestion however unfortunately we are governed by the spec in terms of api design and I can't see any references to supporting proxy config there. What I would suggest is first testing the native http_proxy env variable which based on some searching should work as per below:
ENV['http_proxy'] = 'http://172.16.3.160:4226' # your http://address:port here
And if that fails, raising a spec issue to discuss adding the ability to proxy address.
| def initialize(endpoint: nil, | ||
| certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'), | ||
| client_certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE'), | ||
| client_key_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY', 'OTEL_EXPORTER_OTLP_CLIENT_KEY'), | ||
| ssl_verify_mode: Exporter.ssl_verify_mode, | ||
| headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}), | ||
| compression: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION', default: 'gzip'), | ||
| timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10), | ||
| metrics_reporter: nil) | ||
| metrics_reporter: nil, | ||
| proxy_address: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_ADDRESS', 'OTEL_EXPORTER_OTLP_PROXY_ADDRESS'), | ||
| proxy_port: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_PORT', 'OTEL_EXPORTER_OTLP_PROXY_PORT')) |
There was a problem hiding this comment.
This is based on https://opentelemetry.io/docs/specs/otel/protocol/exporter/ so unfortunately I don't think it is that simple to maintain compatability with the spec.
| proxy_address: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_ADDRESS', 'OTEL_EXPORTER_OTLP_PROXY_ADDRESS'), | ||
| proxy_port: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_PORT', 'OTEL_EXPORTER_OTLP_PROXY_PORT')) |
There was a problem hiding this comment.
I don't see either of these environment variables listed at https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
|
Thanks so much for the reply!
The problem is that we need a way to explicitly configure whether or not to
use which proxy, rather than the implicit, all or nothingmethod those
environment variables offer. We have several different competing reasons
for this unfortunately.
I'll take a look at the spec closely and see where we can plumb it in via a
compliant method.
…On Sat, May 30, 2026, 10:35 PM James Thompson ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks for the suggestion however unfortunately we are governed by the
spec in terms of api design and I can't see any references to supporting
proxy config there. What I would suggest is first testing the native
http_proxy env variable which based on some searching should work as per
below:
ENV['http_proxy'] = 'http://172.16.3.160:4226' # your http://address:port
here
And if that fails, raising a spec issue to discuss adding the ability to
proxy address.
------------------------------
In exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb
<#2167 (comment)>
:
> @@ -53,12 +53,14 @@ def initialize(endpoint: nil,
headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}),
compression: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION', default: 'gzip'),
timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10),
- metrics_reporter: nil)
+ metrics_reporter: nil,
+ proxy_address: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_ADDRESS', 'OTEL_EXPORTER_OTLP_PROXY_ADDRESS'),
+ proxy_port: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_PORT', 'OTEL_EXPORTER_OTLP_PROXY_PORT'))
This is based on
https://opentelemetry.io/docs/specs/otel/protocol/exporter/ so
unfortunately I don't think it is that simple to maintain compatability
with the spec.
------------------------------
In exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb
<#2167 (comment)>
:
> + proxy_address: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_ADDRESS', 'OTEL_EXPORTER_OTLP_PROXY_ADDRESS'),
+ proxy_port: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_TRACES_PROXY_PORT', 'OTEL_EXPORTER_OTLP_PROXY_PORT'))
I don't see either of these environment variables listed at
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
—
Reply to this email directly, view it on GitHub
<#2167?email_source=notifications&email_token=AADS6YAEO7PAI777WENU44L45PABBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMZZGY2DCNJXGQY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-4396415741>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADS6YB4KKD4JQWXJUFJ2M345PABBAVCNFSM6AAAAACZTBU65GVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DGOJWGQYTKNZUGE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AADS6YEICZU2SQS4MRIXE3L45PABBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMZZGY2DCNJXGQY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AADS6YBYLCSOHQ356ZBIJPT45PABBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMZZGY2DCNJXGQY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
If you prefer not to use the implicit HTTP proxy support provided by the standard e.g. hacky way
exporter = OpenTelemetry::Exporter::OTLP::Exporter.new
exporter.instance_variable_set(:@http, Net::HTTP.new(...)) |
|
Hi @SpamapS, thanks for opening this PR! I wanted to check in on the CLA progress. How are things going? |
This allows more fine-graned control over proxy configurations of various exporters.
Fixes #2166