6 releases

Uses new Rust 2024

0.0.2 Mar 1, 2025
0.0.1 Feb 16, 2025
0.0.1-beta.3 Dec 22, 2024
0.0.1-beta.2 Dec 15, 2024
0.0.1-beta.0 Dec 9, 2024

#449 in Database interfaces

Download history 159/week @ 2024-12-07 220/week @ 2024-12-14 131/week @ 2024-12-21 6/week @ 2024-12-28 4/week @ 2025-01-04 3/week @ 2025-01-11 102/week @ 2025-02-15 8/week @ 2025-02-22 154/week @ 2025-03-01 5/week @ 2025-03-08

269 downloads per month

MIT license

145KB
3.5K SLoC

License Crates.io Docs

Tracing Live

In Progress!.

Tracing your Rust program in real time. based on Tracing

Features

  • Real-time Span, Event, and Field tracking
  • Structured relational data
  • Multi-node, multi-app instances
  • AsyncReadAsyncWrite integrated

Start Server

docker run --name timescaledb -d -p 5432:5432 -e POSTGRES_PASSWORD=<You Posgtres Password> -v <Your Posgtres Data Dir>:/var/lib/postgresql/data timescale/timescaledb:latest-pg16

docker run --name tracing-live-server -d -p 443:443 -p 8080:8080 -e DATABASE_URL="postgresql://postgres:123456@host.docker.internal:5432/postgres" --add-host=host.docker.internal:host-gateway ycysdf/tracing-live-server

web server address:https://localhost

Setup Client

dependencies:

tracing-lv = { version = "0.0.1" }
tracing = "0.1"
tokio = { version = "1", features = ["rt", "rt-multi-thread"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
uuid = { version = "1", features = ["v4"] }
anyhow = "1"

Simple Sample:

use tracing::{info, info_span, warn};
use tracing_lv::TLSubscriberExt;
use tracing_lv::TLAppInfo;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
   tracing_subscriber::registry()
      .tracing_lv_init(
         "http://localhost:8080",
         TLAppInfo::new(
            uuid::uuid!("f7570e13-d331-40f7-8d04-e87530308c05"), // App Identify
            "Simple App",                                        // App Name
            "1.0", // App Version. Code Changed. this value should change
         )
            .node_id("TestNode") // Node Identify
            .with_data("brief", "IP")
            .with_data("second_name", "Cur Os Name"),
         Default::default(),
         app_main,
      )
      .await?
}

async fn app_main() -> anyhow::Result<()> {
   info!("Hello, world!");
   info_span!("Test Span").in_scope(|| {
      info!("Info Event!");
      warn!("Warn Event!")
   });
   info!(a = 123, b = "String", "start do");
   for _ in 0..10 {
      info!("do something");
      tokio::time::sleep(std::time::Duration::from_secs(1)).await;
   }
   info!("App End!");
   Ok(())
}

For more examples, see examples

License

MIT License (LICENSE-MIT)

Dependencies

~15–26MB
~374K SLoC