-
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
Add ForceFlush to TracerProvider in SDK #588
Add ForceFlush to TracerProvider in SDK #588
Conversation
Codecov Report
@@ Coverage Diff @@
## main #588 +/- ##
==========================================
+ Coverage 94.41% 94.46% +0.04%
==========================================
Files 200 200
Lines 9080 9087 +7
==========================================
+ Hits 8573 8584 +11
+ Misses 507 503 -4
|
sdk/src/trace/tracer_provider.cc
Outdated
|
||
bool TracerProvider::ForceFlush(std::chrono::microseconds timeout) noexcept | ||
{ | ||
return GetProcessor()->Shutdown(timeout); |
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.
Curious - do we want to call ForceFlush or Shutdown? (I thought the latter)
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.
As per the specs (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#forceflush):
ForceFlush MUST invoke ForceFlush on all registered SpanProcessors.
So ForceFlush() method needs to be defined both for SpanProcessor and Exporter. This can be done as separate PR and in that case Shutdown() call can be removed for now from above.
Note: PR to update specs for adding ForceFlush in Exporter is still open ( open-telemetry/opentelemetry-specification#1467 )
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.
I think we only support one
SpanProcessor
now.
That's fine, I think we could support multiple processors by using a de-mux processor (so from the provider perspective, there is only one processor).
Here are some examples:
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.
Fixes #587
Changes
Add
ForceFlush
to TracerProvider as per the spec PR open-telemetry/opentelemetry-specification#1452For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes