-
Notifications
You must be signed in to change notification settings - Fork 423
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
Synchronized calls to Exporter::Export & Shutdown #1164
Synchronized calls to Exporter::Export & Shutdown #1164
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1164 +/- ##
==========================================
- Coverage 93.29% 93.29% -0.00%
==========================================
Files 174 174
Lines 6391 6402 +11
==========================================
+ Hits 5962 5972 +10
- Misses 429 430 +1
|
…down' of https://github.com/esigo/opentelemetry-cpp into Synchronized-calls-to-Exporter-Export-and-Exporter-Shutdown
@@ -39,7 +40,7 @@ std::unique_ptr<trace_sdk::Recordable> JaegerExporter::MakeRecordable() noexcept | |||
sdk_common::ExportResult JaegerExporter::Export( | |||
const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans) noexcept | |||
{ | |||
if (is_shutdown_) | |||
if (isShutdown()) |
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 - not directly related to this PR, but while you are changing this piece of code, could you also add error logging wherever missing?
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.
done
@@ -5,6 +5,7 @@ | |||
|
|||
#include <opentelemetry/ext/http/client/http_client.h> | |||
#include <opentelemetry/sdk/trace/exporter.h> | |||
#include "opentelemetry/common/spin_lock_mutex.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.
Use #include <>
for consistency?
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.
done
{ | ||
OTEL_INTERNAL_LOG_ERROR("[Jaeger Trace Exporter] Export failed, exporter is shutdown"); |
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.
Log the size of span
to imply how many spans are lost?
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.
added where possible
Fixes #1158 (issue)
Changes
Protects
is_shutdown_
read and writes usingopentelemetry::common::SpinLockMutex
.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes