feat: export aggregate Prometheus metrics
This commit is contained in:
@@ -40,6 +40,15 @@ test('overview() returns real aggregated shape, never throws on the repo state',
|
||||
assert.ok(o.audit_chain.records >= 0);
|
||||
});
|
||||
|
||||
test('prometheusMetrics() exports aggregate-safe operational metrics only', () => {
|
||||
const metrics = new TelemetryService().prometheusMetrics();
|
||||
assert.match(metrics, /^# HELP casan_telemetry_stale/m);
|
||||
assert.match(metrics, /^casan_runs_total \d+/m);
|
||||
assert.match(metrics, /^casan_security_blocks_total \d+/m);
|
||||
assert.match(metrics, /^casan_governance_denials_total \d+/m);
|
||||
assert.doesNotMatch(metrics, /trace_id|tenant|prompt|evidence/i);
|
||||
});
|
||||
|
||||
test('security()/governance()/cost() return objects with expected keys', () => {
|
||||
const svc = new TelemetryService();
|
||||
assert.ok(typeof (svc.security() as any).by_status === 'object');
|
||||
|
||||
Reference in New Issue
Block a user