Feature/outbox structured observability - #1229
Merged
Baskarayelu merged 4 commits intoJul 30, 2026
Merged
Conversation
…redenceOrg#1003) - Add 3 Grafana panels for dead letter, quarantine, and leader election metrics - Update both observability docs with outbox_quarantine_total, outbox_leader_acquired_total, outbox_leader_lost_total metrics - Add edge-case tests for gauge reset on stop and no-payload-in-logs
|
@charliechinedu19-netizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace remaining
console.*calls in the outbox publisher with structured logging and add comprehensive Prometheus metrics, Grafana dashboards, and documentation for outbox observability.Closes #1003
Changes
Metrics (already implemented, verified)
The following metrics were already present in
src/observability/outboxMetrics.ts:outbox_published_total(Counter) — events successfully publishedoutbox_failed_total(Counter) — events that failed to publishoutbox_pending_gauge(Gauge) — current backlog of pending eventsoutbox_lease_renew_total(Counter) — lease renewals during processingincrementOutboxDeadLetter— dead-letter trackingincrementOutboxQuarantine— quarantine trackingincrementOutboxLeaderAcquired/incrementOutboxLeaderLost— leader electionAll
console.*calls were already replaced with structuredlogger.*calls.Grafana Dashboard (
monitoring/grafana/dashboard.json)y=48to make roomDocumentation
outbox_quarantine_total,outbox_leader_acquired_total,outbox_leader_lost_totalto the metrics tableTests (
src/db/outbox/publisher.test.ts)setOutboxPendingGauge(0)is called when the publisher stopsTesting
src/db/outbox/publisher.test.ts— 23/23 tests pass (22 existing + 2 new)src/db/outbox/,src/middleware/metrics.test.ts,src/observability/) — 120/120 tests pass