MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / prometheus_export

Function prometheus_export

nodedb/src/control/security/observability.rs:335–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333
334 #[test]
335 fn prometheus_export() {
336 let m = AuthMetrics::new();
337 m.record_auth_success("jwt");
338 m.rls_denied_total.fetch_add(5, Ordering::Relaxed);
339 let output = m.to_prometheus();
340 assert!(output.contains("nodedb_auth_success_total{method=\"jwt\"} 1"));
341 assert!(output.contains("nodedb_rls_denied_total 5"));
342 assert!(output.contains("nodedb_jwt_validation_duration_seconds_bucket"));
343 }
344}

Callers

nothing calls this directly

Calls 2

record_auth_successMethod · 0.45
to_prometheusMethod · 0.45

Tested by

no test coverage detected