Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Comment on lines +57 to +58

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see either of these environment variables listed at https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/

@uri = prepare_endpoint(endpoint)

raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || %w[gzip none].include?(compression)

@http = http_connection(@uri, ssl_verify_mode, certificate_file, client_certificate_file, client_key_file)
@http = http_connection(@uri, ssl_verify_mode, certificate_file, client_certificate_file, client_key_file, proxy_address: proxy_address, proxy_port: proxy_port)

@path = @uri.path
@headers = prepare_headers(headers)
Expand Down Expand Up @@ -123,8 +125,8 @@ def build_span_flags(parent_span_is_remote, base_flags)
flags
end

def http_connection(uri, ssl_verify_mode, certificate_file, client_certificate_file, client_key_file)
http = Net::HTTP.new(uri.hostname, uri.port)
def http_connection(uri, ssl_verify_mode, certificate_file, client_certificate_file, client_key_file, proxy_address: nil, proxy_port: nil)
http = Net::HTTP.new(uri.hostname, uri.port, proxy_address, proxy_port)
http.use_ssl = uri.scheme == 'https'
http.verify_mode = ssl_verify_mode
http.ca_file = certificate_file unless certificate_file.nil?
Expand Down
Loading