use std::error::Error;
use std::time::Duration;
fn main() -> Result<(), Box<dyn Error>> {
let handles = otel_bootstrap::Telemetry::builder("custom-config-example")
.with_version(env!("CARGO_PKG_VERSION"))
.with_environment("development")
.with_sampler(otel_bootstrap::TraceSampler::AlwaysOn)
.with_metrics(true)
.with_logs(true)
.with_shutdown_timeout(Duration::from_secs(10))
.init()?;
tracing::info!(target: "example", "custom_config example running");
{
use tracing::info_span;
let _span = info_span!("example.custom", config = "full").entered();
tracing::info!("inside custom-configured span");
}
handles.shutdown()?;
Ok(())
}