-
Notifications
You must be signed in to change notification settings - Fork 485
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
Enable reqwest and reqwest-blocking client creation with custom timeout #2584
Enable reqwest and reqwest-blocking client creation with custom timeout #2584
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2584 +/- ##
=======================================
- Coverage 79.5% 79.3% -0.2%
=======================================
Files 118 118
Lines 22476 22487 +11
=======================================
- Hits 17874 17844 -30
- Misses 4602 4643 +41 ☔ View full report in Codecov by Sentry. |
…try-rust into otel-otlp-http-timeout
opentelemetry-otlp/CHANGELOG.md
Outdated
- `OTEL_EXPORTER_OTLP_TIMEOUT` env variable. | ||
- `with_http().with_timeout()` API method of | ||
`LogExporterBuilder` and `SpanExporterBuilder` and `MetricsExporterBuilder`. | ||
- The default interval of 30sec is used if none is configured. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It's indeed 10sec. Have update the changelog accordingly.
pub const OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT: u64 = 10; |
.take() | ||
.ok_or(crate::Error::NoHttpClient)?; | ||
|
||
#[allow(unused_mut)] // TODO - clippy thinks mut is not needed, but it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is another issue about parsing env variables for timeout, I opened #2591 to track it separate from this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. For metrics we'd need a follow up as we need to use a per-request timeout override, to account for the the time taken for observable callbacks.
Also need to fix the changelog to state its 10 secs default, not 30.
Fix: towards #2576
Changes
This PR defers the creation of http_client until the configured timeout is accessible. Previously, http_client was initialized within
HttpConfig::default()
, where the timeout value was unavailable.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes