#[cfg(feature = "profiling")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
use tracing::info_span;
let handles = otel_bootstrap::Telemetry::builder("telemetry-profiling-example")
.with_profiling("http://localhost:4040")
.init()?;
let _span = info_span!("example.work", step = 1).entered();
tracing::info!("telemetry_profiling example running");
drop(_span);
handles.shutdown()?;
Ok(())
}
#[cfg(not(feature = "profiling"))]
fn main() {
eprintln!(
"telemetry_profiling example requires the `profiling` feature: \
cargo run --example telemetry_profiling --features profiling-bridge-pyroscope-rs"
);
}