basic/
basic.rs

1//! Basic example showing how telemetry-kit will work
2//!
3//! Run with:
4//! ```
5//! cargo run --example basic
6//! ```
7
8use telemetry_kit::prelude::*;
9
10fn main() {
11    println!("telemetry-kit v{}", env!("CARGO_PKG_VERSION"));
12    println!();
13    println!("This is a placeholder example.");
14    println!("The actual implementation is under development.");
15    println!();
16    
17    // This is how it will work in v0.1.0+:
18    println!("Example of planned API:");
19    println!();
20    println!(r#"
21    use telemetry_kit::prelude::*;
22
23    #[tokio::main]
24    async fn main() -> Result<(), Box<dyn std::error::Error>> {{
25        let _guard = telemetry_kit::init()
26            .service_name("my-app")
27            .endpoint("https://telemetry.myapp.com")
28            .anonymous()
29            .init()?;
30        
31        do_work().await?;
32        
33        Ok(())
34    }}
35
36    #[instrument]
37    async fn do_work() -> Result<(), Box<dyn std::error::Error>> {{
38        // Your code here - automatically instrumented!
39        Ok(())
40    }}
41    "#);
42    
43    // Current minimal implementation:
44    let _guard = telemetry_kit::init()
45        .service_name("basic-example")
46        .init();
47    
48    println!();
49    println!("✓ Basic initialization successful (placeholder)");
50}