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:
Bryan Garza
2022-06-06 11:53:01 -07:00
committed by GitHub
parent 10da627102
commit 388fff8371

View File

@@ -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(())