mirror of
https://github.com/tokio-rs/tracing.git
synced 2026-03-19 06:12:30 +00:00
opentelemetry: add more comments to example (#2140)
This patch adds a bit more context around why we are creating a smaller scope for the spans, and also what happens when we call `global::shutdown_tracer_provider()` (that comment was copied from the`rust-opentelemetry` repo). Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
@@ -38,8 +38,11 @@ fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
|
||||
|
||||
warn!("About to exit!");
|
||||
trace!("status: {}", work_result);
|
||||
}
|
||||
} // Once this scope is closed, all spans inside are closed as well
|
||||
|
||||
// Shut down the current tracer provider. This will invoke the shutdown
|
||||
// method on all span processors. span processors should export remaining
|
||||
// spans before return.
|
||||
global::shutdown_tracer_provider();
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user