-
Notifications
You must be signed in to change notification settings - Fork 446
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
[EXPORTER] Support handling retry-able errors for OTLP/HTTP #3223
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3223 +/- ##
==========================================
+ Coverage 87.71% 87.78% +0.07%
==========================================
Files 198 198
Lines 6273 6308 +35
==========================================
+ Hits 5502 5537 +35
Misses 771 771
|
c4d037c
to
2e5d7d8
Compare
2e5d7d8
to
48402d9
Compare
d7be7c0
to
9d0aa22
Compare
9d0aa22
to
4de2f81
Compare
99f7dd8
to
f0abd5b
Compare
f0abd5b
to
2e3ec77
Compare
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.
Excellent work.
The only part remaining at this point is to add a feature flag:
In CMakeList.txt, define a new option WITH_OTLP_RETRY_PREVIEW
, default OFF
The same option name should be fine for both HTTP and gRPC.
In api/CMakeList.txt, add a target_compile_definitions (aka, a define), for ENABLE_OTLP_RETRY_PREVIEW
Use ifdef ENABLE_OTLP_RETRY_PREVIEW to protect the code path for this feature. A good place could be inside the implementation of IsRetryable().
Adjust the unit tests using the same ifdef, to make sure they pass when compiling with and without WITH_OTLP_RETRY_PREVIEW.
In CI, add WITH_OTLP_RETRY_PREVIEW=ON in all maintainer builds.
Having a feature flag is needed because:
- the environment variables are not in the spec yet, so this code is considered experimental and subject to change
- the code itself is new, so this mitigates risks for people in production with the OTLP exporter. Adoption will be voluntary since the default is OFF.
Much later, the feature flag will be ON by default, and then removed, assuming we get this in the spec at some point, to declare the whole thing stable.
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
Excellent work, thanks for the feature.
1f609ea
to
f8b6a09
Compare
Ok to ignore CI failurews for test |
Sorry for the merge conflicts. This should be trivial, as we both added some members in the same place, let me know if you need help with resolving. Please note that there is a new constructor in ext, for HttpClient, so your changes will be needed there as well. I will review again after conflict resolution anyway. |
exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h
Show resolved
Hide resolved
Please resolve the merge conflicts, or indicate if you need help with this. Thanks (and sorry for the conflicts) |
Apologies for the delay, having a hard time finding time for this during the week. Conflicts resolved but I have to look into addressing a concern raised in this discussion |
bool HttpClient::doRetrySessions(bool report_all) | ||
{ |
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.
nit, optional:
Please use ifdef ENABLE_OTLP_RETRY_PREVIEW as well in HttpClient::doRetrySessions(), to protect this code path.
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 now, thanks.
[EXPORTER] Support handling retry-able errors for OTLP/HTTP (open-telemetry#3223)
Contributes to #2049
Changes
This change introduces a retry mechanism for OTLP/HTTP for select failures, mimicking the same exponential backoff approach used in OTLP/gRPC.
The changes to support retries for OTLP/gRPC exporter are addressed in #3219
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes