Skip to content
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

Merged
merged 17 commits into from
Mar 15, 2021

Conversation

Oberon00
Copy link
Member

Fixes #1454.

Changes

Adds ForceFlush (which already existed in SdkTracerProvider and SpanProcessor) to SpanExporter, and adds wording that SpanProcessor.ForceFlush must call that new SpanExporter.ForceFlush.

@Oberon00 Oberon00 added area:sdk Related to the SDK spec:trace Related to the specification/trace directory labels Feb 25, 2021
@Oberon00 Oberon00 requested a review from a team as a code owner February 25, 2021 14:20
@Oberon00 Oberon00 requested a review from a team February 25, 2021 14:20
@Oberon00 Oberon00 requested a review from a team as a code owner February 25, 2021 14:20
CHANGELOG.md Outdated Show resolved Hide resolved
specification/trace/sdk.md Outdated Show resolved Hide resolved
specification/trace/sdk.md Show resolved Hide resolved
specification/trace/sdk.md Show resolved Hide resolved
specification/trace/sdk.md Show resolved Hide resolved
specification/trace/sdk.md Outdated Show resolved Hide resolved
Oberon00 and others added 2 commits February 25, 2021 18:44
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
@carlosalberto
Copy link
Contributor

Overall LGTM, although this is precisely one of the interfaces that are exposed to the users and needs special care and some thought on whether some kind of 'default method' can be offered in the different SIGs.

cc @bogdandrutu

@@ -582,6 +588,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()`
Copy link
Member

Choose a reason for hiding this comment

The 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 :)

specification/trace/sdk.md Outdated Show resolved Hide resolved
Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think timeout has higher priority, so the processor should not try to push more items to the exporter when timeout happened.

specification/trace/sdk.md Outdated Show resolved Hide resolved
@bogdandrutu
Copy link
Member

I think timeout has higher priority, so the processor should not try to push more items to the exporter when timeout happened.

I agree with @reyang here, we should should return when the deadline happens and not try to over-engineer the logic, if too short you get done what was possible during the amount of time.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for driving this! 💯

`ForceFlush` SHOULD complete or abort within some timeout. `ForceFlush` can be
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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ForceFlush should return (complete or abort) as soon as possible if the given timeout is reached?

Copy link
Member Author

Choose a reason for hiding this comment

The 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).

@github-actions
Copy link

github-actions bot commented Mar 6, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 6, 2021
@bogdandrutu
Copy link
Member

@Oberon00 please rebase :) that will also remove the stale

@bogdandrutu bogdandrutu removed the Stale label Mar 9, 2021
@bogdandrutu
Copy link
Member

Please rebase

@bogdandrutu
Copy link
Member

@arminru can you rebase & review & and merge if you are ok with this change :)

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.
Copy link
Member

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.

spec-compliance-matrix.md Outdated Show resolved Hide resolved
spec-compliance-matrix.md Outdated Show resolved Hide resolved
spec-compliance-matrix.md Outdated Show resolved Hide resolved
@arminru arminru merged commit 3210212 into open-telemetry:main Mar 15, 2021
@arminru arminru deleted the exporter-forceflush branch March 15, 2021 17:01
ThomsonTan pushed a commit to ThomsonTan/opentelemetry-specification that referenced this pull request Mar 30, 2021
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk Related to the SDK spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ForceFlush missing from Exporter spec
8 participants