-
Notifications
You must be signed in to change notification settings - Fork 831
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
Add connectTimeout configuration option OtlpHttp{Signal}Exporters #5941
Merged
jack-berg
merged 3 commits into
open-telemetry:main
from
jack-berg:configurable-connect-timeout
Dec 7, 2023
Merged
Add connectTimeout configuration option OtlpHttp{Signal}Exporters #5941
jack-berg
merged 3 commits into
open-telemetry:main
from
jack-berg:configurable-connect-timeout
Dec 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5941 +/- ##
============================================
+ Coverage 91.16% 91.18% +0.02%
- Complexity 5666 5683 +17
============================================
Files 625 625
Lines 16618 16666 +48
Branches 1641 1648 +7
============================================
+ Hits 15149 15197 +48
+ Misses 1019 1018 -1
- Partials 450 451 +1 ☔ View full report in Codecov by Sentry. |
mikelaspina
approved these changes
Nov 3, 2023
trask
approved these changes
Dec 7, 2023
Comment on lines
+2
to
+13
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporterBuilder setConnectTimeout(long, java.util.concurrent.TimeUnit) | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporterBuilder setConnectTimeout(java.time.Duration) | ||
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder (not serializable) | ||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setConnectTimeout(long, java.util.concurrent.TimeUnit) | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setConnectTimeout(java.time.Duration) | ||
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder (not serializable) | ||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0 | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setConnectTimeout(long, java.util.concurrent.TimeUnit) | ||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setConnectTimeout(java.time.Duration) |
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.
✅
…y-java into configurable-connect-timeout
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connect timeouts are common failure mode for OTLP exporters. Retrying when a connection error occurs can improve the chances of a successful export.
As of version 1.31.0, the JdkHttpSender has no connect timeout, and will use the entire timeout period trying to establish a connection. The OkHttpHttpSender has a static connect timeout of 10s. #5867 updates JdkhttpSender to have static connect timeout of 10s aligned with OkHttpHttpSender. However, if you want to enable retries and have a total timeout of < 10s, the export will spend the entire timeout trying to connect.
Allowing the connect timeout to be configurable allows exporters to trigger retries earlier and possibly succeed.
This PR adds new
setConnectTimeout(..)
methods to theOtlpHttp{Signal}ExporterBuilder
s. This concept should make sense for theOtlpGrpc{Signal}Exporter
s as well. I can add that in a followup if folks agree with the direction.