-
Notifications
You must be signed in to change notification settings - Fork 888
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 SpanExporter.ForceFlush. #1467
Changes from 11 commits
e02d40c
43f12aa
4be0529
5f8f890
2f27ddf
04e3e29
c74590f
a9b7c8c
e2a36ff
a04f68e
9be7b76
1d26e92
e71c9ef
59a05e0
4b79b87
a4e9209
30af37a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -473,14 +473,24 @@ make the shutdown timeout configurable. | |
|
||
#### ForceFlush() | ||
|
||
Exports all spans that have not yet been exported to the configured `Exporter`. | ||
This is a hint to ensure that any tasks associated with `Spans` for which the | ||
`SpanProcessor` had already received events prior to the call to `ForceFlush` SHOULD | ||
be completed as soon as possible, preferably before returning from this method. | ||
|
||
In particular, if any `SpanProcessor` has any associated exporter, it SHOULD | ||
try to call the exporter's `Export` with all spans for which this was not | ||
already done and then invoke `ForceFlush` on it. | ||
The [built-in SpanProcessors](#built-in-span-processors) MUST do so. | ||
If a timeout is specified (see below), the SpanProcessor MUST prioritize honoring the timeout over | ||
finishing all calls. It MAY skip or abort some or all Export or ForceFlush | ||
calls it has made to achieve this goal. | ||
|
||
`ForceFlush` SHOULD provide a way to let the caller know whether it succeeded, | ||
failed or timed out. | ||
|
||
`ForceFlush` SHOULD only be called in cases where it is absolutely necessary, | ||
such as when using some FaaS providers that may suspend the process after an | ||
invocation, but before the `Processor` exports the completed spans. | ||
invocation, but before the `SpanProcessor` exports the completed spans. | ||
|
||
`ForceFlush` SHOULD complete or abort within some timeout. `ForceFlush` can be | ||
arminru marked this conversation as resolved.
Show resolved
Hide resolved
|
||
implemented as a blocking API or an asynchronous API which notifies the caller | ||
|
@@ -588,6 +598,24 @@ return a `Failure` result. | |
and the destination is unavailable). OpenTelemetry client authors can decide if they | ||
want to make the shutdown timeout configurable. | ||
|
||
#### `ForceFlush()` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can say, in case of stable releases a "no-op" implementation can be offered as a default. I think that is the best we can do :) |
||
|
||
This is a hint to ensure that the export of any `Spans` the exporter has received prior to the | ||
call to `ForceFlush` SHOULD be completed as soon as possible, preferably before | ||
arminru marked this conversation as resolved.
Show resolved
Hide resolved
|
||
returning from this method. | ||
|
||
`ForceFlush` SHOULD provide a way to let the caller know whether it succeeded, | ||
failed or timed out. | ||
|
||
`ForceFlush` SHOULD only be called in cases where it is absolutely necessary, | ||
such as when using some FaaS providers that may suspend the process after an | ||
invocation, but before the exporter exports the completed spans. | ||
|
||
`ForceFlush` SHOULD complete or abort within some timeout. `ForceFlush` can be | ||
arminru marked this conversation as resolved.
Show resolved
Hide resolved
|
||
implemented as a blocking API or an asynchronous API which notifies the caller | ||
via a callback or an event. OpenTelemetry client authors can decide if they want to | ||
make the flush timeout configurable. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For blocking API, I think it is very hard to abort within some timeout. Like the implementation complies to the spec if it just does abort its entry point without doing any work. Should we say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is copy & past from shutdown and the other ForceFlush. Please open an issue if you want tor reword this (should be consistent everywhere). |
||
|
||
### Further Language Specialization | ||
|
||
Based on the generic interface definition laid out above library authors must | ||
|
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.
@Oberon00 Please add an entry in the compliance matrix for that, otherwise it might be overlooked easily.