pub fn shutdown_tracer_provider(provider: &TracerProvider)Expand description
Properly shuts down a tracer provider, flushing pending spans and cleaning up resources.
This function performs a graceful shutdown of the tracer provider by:
- Attempting to flush any pending spans to the exporter
- Shutting down the tracer provider and its associated resources
- Logging any errors that occur during the shutdown process
§Arguments
provider: Reference to theTracerProviderto shut down
§Examples
use telemetry_rust::{init_tracing, shutdown_tracer_provider};
use tracing::Level;
let tracer_provider = init_tracing!(Level::INFO);
// Your application code here...
shutdown_tracer_provider(&tracer_provider);