feat(ingest): label er_ingest_events_total skipped_noise by rule_id
CI / Test api (push) Successful in 54s
CI / Test ingest-api (push) Successful in 57s
CI / Lint and typecheck admin-ui (push) Successful in 1m48s
CI / Validate Docker build (push) Successful in 5m19s

Break down noise filter counters per noise policy rule for Prometheus observability.

Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-26791
Paperclip-Run: cea24469-2886-457d-9f6f-09d83aaf9e4a
This commit is contained in:
David Santos committed 2026-07-17 23:01:35 +00:00
1 parent caeb37ff0a
commit 23704d2e59
7 files changed
+43 -11

No files matched your search

@@ -0,0 +1,15 @@
import { describe, expect, it } from "vitest";
import { ingestEventsTotal, prometheusRegistry } from "./prometheus.js";
describe("er_ingest_events_total rule_id label (BIT-26791)", () => {
it("records skipped_noise with rule_id", async () => {
ingestEventsTotal.inc(
{ outcome: "skipped_noise", rule_id: "resize_observer_loop" },
1,
);
const _text = await prometheusRegistry.metrics();
expect(_text).toContain(
'er_ingest_events_total{outcome="skipped_noise",rule_id="resize_observer_loop"}',
);
});
});
+2 -1
View File
@@ -34,7 +34,8 @@ export const ingestDuration = new Histogram({
export const ingestEventsTotal = new Counter({
name: "er_ingest_events_total",
help: "Total events ingested",
labelNames: ["outcome"] as const, // stored, skipped_noise, error
// rule_id is set for skipped_noise (noise policy id); empty for stored/error
labelNames: ["outcome", "rule_id"] as const,
registers: [register],
});