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 TracerProvider #1608

Merged
merged 10 commits into from
Mar 8, 2021

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented 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.

Part of #1606

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 added pkg:SDK Related to an SDK package area:trace Part of OpenTelemetry tracing release:required-for-ga labels Feb 26, 2021
@MrAlias MrAlias added this to the RC1 milestone Feb 26, 2021
@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #1608 (9c1bd20) into main (bd0bba4) will decrease coverage by 0.2%.
The diff coverage is 32.5%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #1608     +/-   ##
=======================================
- Coverage   77.4%   77.1%   -0.3%     
=======================================
  Files        128     128             
  Lines       6705    6736     +31     
=======================================
+ Hits        5192    5197      +5     
- Misses      1266    1288     +22     
- Partials     247     251      +4     
Impacted Files Coverage Δ
sdk/trace/simple_span_processor.go 85.0% <0.0%> (-4.5%) ⬇️
sdk/trace/provider.go 82.7% <30.4%> (-12.3%) ⬇️
sdk/trace/batch_span_processor.go 74.3% <37.5%> (-4.6%) ⬇️
exporters/otlp/otlpgrpc/connection.go 86.9% <0.0%> (-1.9%) ⬇️

sdk/trace/provider.go Outdated Show resolved Hide resolved
sdk/trace/batch_span_processor.go Outdated Show resolved Hide resolved
sdk/trace/batch_span_processor.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@MrAlias MrAlias closed this Mar 8, 2021
@MrAlias MrAlias reopened this Mar 8, 2021
@MrAlias MrAlias merged commit 3dc91f2 into open-telemetry:main Mar 8, 2021
@MrAlias MrAlias deleted the tp-force-flush branch March 8, 2021 19:12
@MrAlias MrAlias mentioned this pull request Mar 18, 2021
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 pkg:SDK Related to an SDK package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants