otlp-embedded

Crates.iootlp-embedded
lib.rsotlp-embedded
version0.0.1
sourcesrc
created_at2024-01-03 07:05:26.96093
updated_at2024-01-03 07:05:26.96093
descriptionIn-memory OpenTelemetry trace collector and Web UI visualizer.
homepage
repositoryhttps://github.com/risingwavelabs/otlp-embedded
max_upload_size
id1087168
size11,839,012
Bugen Zhao (BugenZhao)

documentation

README

otlp-embedded

A simple in-memory implementation of the OpenTelemetry trace collector with a Web UI for visualizing the traces that can be embedded into other Rust applications.

Example

use otlp_embedded::{ui_app, State, TraceServiceImpl, TraceServiceServer};

#[tokio::main]
async fn main() {
    let state = State::new(100);
    let state_clone = state.clone();

    tokio::spawn(async {
        axum::Server::bind(&"0.0.0.0:10188".parse().unwrap())
            .serve(ui_app(state, "/").into_make_service())
            .await
            .unwrap();
    });

    tonic::transport::Server::builder()
        .add_service(TraceServiceServer::new(TraceServiceImpl::new(state_clone)))
        .serve("0.0.0.0:43177".parse().unwrap())
        .await
        .unwrap();
}
Commit count: 0

cargo fmt