feat(ops): add dashboard panel for idempotency conflict counts - #1205
Merged
SheyeJDev merged 1 commit intoAug 30, 2026
Merged
Conversation
Track idempotency 409 conflicts (payload mismatch + in-progress) and cached replays via in-memory counters in the metrics service, exposed on the Prometheus /metrics endpoint, the /ops/status JSON response, and the OpenAPI spec. Wire the counters into the idempotency middleware. Add a live-updating admin dashboard panel with 15s polling and a refresh button. Closes Split-Naira#1165, Split-Naira#1156, Split-Naira#1157. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Dickson2015 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
Adds a live dashboard panel for idempotency 409 conflict and replay counts to the admin ops observability surface.
What changed
Backend
services/metrics.ts— In-memory counters (incrementIdempotencyConflicts,incrementIdempotencyReplays) with getters and reset support.middleware/idempotency.ts— Increments counters on every conflict (payload mismatch + in-progress) and every replay.routes/ops.ts— Exposesidempotency.conflictsTotalandidempotency.replaysTotalin/ops/status.routes/metrics.ts— Exportssplitnaira_idempotency_conflicts_totalandsplitnaira_idempotency_replays_totalin Prometheus exposition format.schemas/admin.schemas.ts+openapi.ts— Schema and OpenAPI docs updated.Frontend
lib/api-client.ts—IdempotencyStatsinterface +getIdempotencyStats()method.lib/api.ts— Re-exports the type and function.components/dashboard/DashboardView.tsx— Admin dashboard panel with 15s polling, error state, and manual refresh button. Only visible to connected contract admins.Tests & Docs
__tests__/metrics.test.ts— Assertions for the new Prometheus counters.docs/openapi.yaml+docs/openapi.json— Regenerated to include theidempotencyfield.Verification
tsc --noEmit --skipLibCheckshows no new errors in touched files.Closes #1165
closes #1156
closes #1157