Add audit maintenance, verified recovery and reproducible verification
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0e6f1-443f-7783-9920-a16b2ffc467f
This commit is contained in:
parent
820f0ff7b5
commit
3166da1d2e
13 changed files with 413 additions and 5 deletions
|
|
@ -214,6 +214,19 @@ class Store:
|
|||
return {row['status']: row['n'] for row in db.execute(
|
||||
"SELECT status,COUNT(*) AS n FROM outbox WHERE status!='delivered' GROUP BY status")}
|
||||
|
||||
def audit_metrics(self, last_drain):
|
||||
"""Private aggregate metrics: no event, actor, or alert labels."""
|
||||
with self.connect() as db:
|
||||
counts = dict(db.execute('SELECT status,COUNT(*) FROM outbox GROUP BY status'))
|
||||
lines = ['# HELP railiance_ack_audit_events Stored audit events by delivery state.',
|
||||
'# TYPE railiance_ack_audit_events gauge']
|
||||
for status in ('pending', 'blocked', 'delivered'):
|
||||
lines.append(f'railiance_ack_audit_events{{status="{status}"}} {counts.get(status, 0)}')
|
||||
lines += ['# HELP railiance_ack_audit_last_drain_timestamp_seconds Last completed local outbox pass; not receiver reachability.',
|
||||
'# TYPE railiance_ack_audit_last_drain_timestamp_seconds gauge',
|
||||
f'railiance_ack_audit_last_drain_timestamp_seconds {float(last_drain)}']
|
||||
return '\n'.join(lines) + '\n'
|
||||
|
||||
|
||||
class Application:
|
||||
"""WSGI adapter. authenticate and authorize are required, never default-allow.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue