Skip to content

feat(ops): add dashboard panel for idempotency conflict counts - #1205

Merged
SheyeJDev merged 1 commit into
Split-Naira:mainfrom
Dickson2015:feat/ops-idempotency-dashboard-panel
Aug 30, 2026
Merged

feat(ops): add dashboard panel for idempotency conflict counts#1205
SheyeJDev merged 1 commit into
Split-Naira:mainfrom
Dickson2015:feat/ops-idempotency-dashboard-panel

Conversation

@Dickson2015

@Dickson2015 Dickson2015 commented Aug 28, 2026

Copy link
Copy Markdown

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 — Exposes idempotency.conflictsTotal and idempotency.replaysTotal in /ops/status.
  • routes/metrics.ts — Exports splitnaira_idempotency_conflicts_total and splitnaira_idempotency_replays_total in Prometheus exposition format.
  • schemas/admin.schemas.ts + openapi.ts — Schema and OpenAPI docs updated.

Frontend

  • lib/api-client.tsIdempotencyStats interface + 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 the idempotency field.

Verification

  • Backend: all 58 relevant tests pass (splits, metrics, openapi, idempotency store).
  • Frontend: tsc --noEmit --skipLibCheck shows no new errors in touched files.

Closes #1165
closes #1156
closes #1157

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>
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@SheyeJDev
SheyeJDev merged commit 82c37a4 into Split-Naira:main Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants