-
Notifications
You must be signed in to change notification settings - Fork 432
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] Ignore exception when create thread in OTLP file exporter. #3012
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3012 +/- ##
==========================================
+ Coverage 87.12% 87.60% +0.49%
==========================================
Files 200 190 -10
Lines 6109 5870 -239
==========================================
- Hits 5322 5142 -180
+ Misses 787 728 -59 |
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, thanks for the fix.
This is mostly code for robustness: if a thread can not be started, we log an error instead of taking the application down, but opentelemetry will execute in degraded mode, possibly not recording data.
In the long term, we may need to pay closer attention to warnings reported by clang-tidy about exceptions raised in noexcept methods, to find and resolve similar issues that may exist elsewhere already.
cc @msiddhu
@@ -20,6 +20,7 @@ | |||
#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h" // IWYU pragma: keep | |||
// clang-format on | |||
|
|||
#include "opentelemetry/common/macros.h" |
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.
macros.h is not needed.
By convention, including version.h also provides macros.h, because it contains the magic line:
#include "opentelemetry/common/macros.h" // IWYU pragma: export
This was done because every file depends on version.h anyway, so code can reliably make use of various defines like OPENTELEMETRY_HAVE_EXCEPTIONS without having to remember to include macros.h.
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.
Reported by include-what-you-use as:
/home/runner/work/opentelemetry-cpp/opentelemetry-cpp/exporters/otlp/src/otlp_file_client.cc should remove these lines:
- #include "opentelemetry/common/macros.h" // lines 23-23
because of the export pragma in version.h.
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.
Thanks, it's removed now.
* [EXPORTER] Ignore exception when create thread in OTLP file exporter. (open-telemetry#3012) * [BUILD] Update MODULE.bazel (open-telemetry#3015) * [BUILD] Fix build without vcpkg on Windows when gRPC is disabled (open-telemetry#3016) * [BUILD] Add abi_version_no bazel flag. (open-telemetry#3020) * [Code health] Expand iwyu coverage to include unit tests. (open-telemetry#3022) * [BUILD] Version opentelemetry_proto/proto_grpc shared libraries (open-telemetry#2992) * [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0 (open-telemetry#3023) * [SDK] Support empty histogram buckets (open-telemetry#3027) * support empty buckets * Update histogram_test.cc * Update histogram_test.cc * test for negative values * fix count * [TEST] Fix sync problems in OTLP File exporter tests. (open-telemetry#3031) --------- Co-authored-by: WenTao Ou <owentou@tencent.com> Co-authored-by: Carbo Kuo <BYVoid@users.noreply.github.com> Co-authored-by: Manuel Bergler <m.bergler@tum.de> Co-authored-by: Marc Alff <marc.alff@oracle.com> Co-authored-by: Troels Hoffmeyer <Troels.d.hoffmeyer@gmail.com> Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
Fixes #3011
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes