Adapts every AuditEvent onto a MetricsRecorder: breakwater.audit.decision
increments with {action, decision} tags — denials, tripwires
(decision: 'error'), rate-limit rejections, escalations, and SLA
breaches all become queryable via those two dimensions without enumerating
actions. When event.detail?.durationSeconds is a finite number, it also
observes breakwater.audit.duration_seconds with a {action} tag — a
generic convention any emitter can adopt (this module does not emit one
itself). No Mastra-tracing duplication: counters/histograms over audit
events only, never spans.
Never throws on a missing, absent, or malformed detail — a non-number,
NaN, Infinity, or NEGATIVE durationSeconds simply skips the observe call
(a duration histogram must stay non-negative; cross-isolate clock skew can
stamp a decide before its create, and that skew is not a duration).
Adapts every AuditEvent onto a MetricsRecorder:
breakwater.audit.decisionincrements with{action, decision}tags — denials, tripwires (decision: 'error'), rate-limit rejections, escalations, and SLA breaches all become queryable via those two dimensions without enumerating actions. Whenevent.detail?.durationSecondsis a finite number, it also observesbreakwater.audit.duration_secondswith a{action}tag — a generic convention any emitter can adopt (this module does not emit one itself). No Mastra-tracing duplication: counters/histograms over audit events only, never spans.Never throws on a missing, absent, or malformed
detail— a non-number, NaN, Infinity, or NEGATIVEdurationSecondssimply skips the observe call (a duration histogram must stay non-negative; cross-isolate clock skew can stamp a decide before its create, and that skew is not a duration).