Function shutdown_tracer_provider

Source
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:

  1. Attempting to flush any pending spans to the exporter
  2. Shutting down the tracer provider and its associated resources
  3. Logging any errors that occur during the shutdown process

§Arguments

§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);