rakka-dashboard 0.2.0

rakka dashboard — optional HTTP/WebSocket observability service with embedded React UI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Cluster state + reachability.

use axum::extract::State;
use axum::Json;

use rakka_telemetry::dto::{ClusterStateInfo, ReachabilityRecord};

use crate::AppState;

pub async fn get_state(State(state): State<AppState>) -> Json<ClusterStateInfo> {
    Json(state.telemetry.cluster.snapshot())
}

pub async fn get_reachability(State(state): State<AppState>) -> Json<Vec<ReachabilityRecord>> {
    Json(state.telemetry.cluster.snapshot().reachability_records)
}