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 a Shutdown() method to TracerProvider #459

Closed
fbogsany opened this issue Oct 27, 2020 · 1 comment
Closed

Add a Shutdown() method to TracerProvider #459

fbogsany opened this issue Oct 27, 2020 · 1 comment

Comments

@fbogsany
Copy link
Contributor

See open-telemetry/opentelemetry-specification#1074

@fbogsany
Copy link
Contributor Author

fbogsany commented Nov 3, 2020

Ironically, it turns out we've had this "forever":

# Attempts to stop all the activity for this {Tracer}. Calls
# SpanProcessor#shutdown for all registered SpanProcessors.
#
# This operation may block until all the Spans are processed. Must be
# called before turning off the main application to ensure all data are
# processed and exported.
#
# After this is called all the newly created {Span}s will be no-op.
def shutdown
@mutex.synchronize do
if @stopped
OpenTelemetry.logger.warn('calling Tracer#shutdown multiple times.')
return
end
@active_span_processor.shutdown
@stopped = true
end
end

It looks like we need minor documentation tweaks - I think this was moved from Tracer to TracerProvider at some point.

@fbogsany fbogsany closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant