open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.82k stars 635 forks source link

Split timeout to read and connect timeouts in the exporters #4303

Open tomeroszlak opened 4 days ago

tomeroszlak commented 4 days ago

https://github.com/open-telemetry/opentelemetry-python/blob/a94eab984db6b794cc59cb2c16cd14d804d1eeaf/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py#L73

I would like to raise an option to split the timeout using a tuple(as mentioned here https://requests.readthedocs.io/en/latest/user/advanced/)

Is your feature request related to a problem? No

Describe the solution you'd like I would like to raise an option to split the timeout using a tuple(as mentioned here https://requests.readthedocs.io/en/latest/user/advanced/) https://github.com/open-telemetry/opentelemetry-python/blob/a94eab984db6b794cc59cb2c16cd14d804d1eeaf/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py#L73

Additional Context n/a

Would you like to implement a fix? Yes

xrmx commented 3 days ago

That kind of syntax is requests specific though, not sure is a good idea to tie the exporter to an http library implementation.

tomeroszlak commented 2 days ago

That kind of syntax is requests specific though, not sure is a good idea to tie the exporter to an http library implementation.

This syntax is indeed requests and urllib3 specific, but all libraries support read and connect timeout split, so we can add 2 env vars of connect and read timeout and then parse them to the current HTTP library syntax that is in use.