Function otlp_embedded::ui_app

source ·
pub fn ui_app(state: StateRef, base_path: &str) -> Router
Expand description

Create a new axum::Router for the Jaeger UI to visualize the traces stored in the given StateRef.

The base_path is used for the application to load static assets correctly. It should start and end with /. For example,

  • if the application is served at http://localhost:3000/, then base_path should be /.
  • if the application is served at http://localhost:3000/trace/, then base_path should be /trace/.
Examples found in repository?
examples/basic.rs (line 10)
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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();
}