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 ForceFlush method to the TracerProvider #1606

Closed
MrAlias opened this issue Feb 25, 2021 · 0 comments
Closed

Add ForceFlush method to the TracerProvider #1606

MrAlias opened this issue Feb 25, 2021 · 0 comments
Assignees
Labels
area:trace Part of OpenTelemetry tracing help wanted Extra attention is needed pkg:SDK Related to an SDK package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Feb 25, 2021

From the specification:

### ForceFlush

This method provides a way for provider to immediately export all spans that have not yet been exported for all the internal processors.

`ForceFlush` SHOULD provide a way to let the caller know whether it succeeded,
failed or timed out.

`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.

`ForceFlush` MUST invoke `ForceFlush` on all registered `SpanProcessors`.

This method needs to be added for compliance.

Once added the specification compliance matrix needs to be updated to indicate that Go implements this method for TracerProviders.

@MrAlias MrAlias added pkg:SDK Related to an SDK package area:trace Part of OpenTelemetry tracing release:required-for-ga labels Feb 25, 2021
@MrAlias MrAlias added this to the RC1 milestone Feb 25, 2021
@MrAlias MrAlias added the help wanted Extra attention is needed label Feb 25, 2021
@MrAlias MrAlias self-assigned this Feb 26, 2021
MrAlias added a commit to MrAlias/opentelemetry-go that referenced this issue Feb 26, 2021
The specification requires that a TracerProvider have a ForceFlush
method that can be set with a timeout, return any error to the caller,
and have all the registered span processors export their spans. This
updates the SpanProcessor.ForceFlush method to accept a context and
return an error and plumbs this method into a new ForceFlush method of
the SDK TracerProvider.

Additionally, this corrects the TracerProvider Shutdown method. This
method as well needs to return to the caller any failure it encounters
according to the specification. This returns an error if it cannot type
assert the spanProcessorStates or if shutting down a span processor
results in an error.

Resolves open-telemetry#1606
@MrAlias MrAlias closed this as completed in 3dc91f2 Mar 8, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:trace Part of OpenTelemetry tracing help wanted Extra attention is needed pkg:SDK Related to an SDK package
Projects
None yet
Development

No branches or pull requests

1 participant