MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / metrics_router

Function metrics_router

crates/openshell-server/src/http.rs:170–174  ·  view source on GitHub ↗

Create the metrics router for the dedicated metrics port.

(handle: PrometheusHandle)

Source from the content-addressed store, hash-verified

168
169/// Create the metrics router for the dedicated metrics port.
170pub fn metrics_router(handle: PrometheusHandle) -> Router {
171 Router::new()
172 .route("/metrics", get(render_metrics))
173 .with_state(handle)
174}
175
176async fn render_metrics(State(handle): State<PrometheusHandle>) -> impl IntoResponse {
177 handle.render()

Callers 1

run_serverFunction · 0.85

Calls 2

getFunction · 0.85
with_stateMethod · 0.80

Tested by

no test coverage detected