feat: admin DLQ tooling, observability metrics, and standardized error responses#208
Merged
robertocarlous merged 2 commits intoJun 24, 2026
Conversation
|
@gotethry 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! 🚀 |
… and auth metrics, standardized errors, and regression tests Resolves Neurowealth#189 Neurowealth#192 Neurowealth#193 Neurowealth#196 ## Changes ### Neurowealth#189 - Admin tooling for DLQ triage and replay operations - Enhanced GET /api/admin/dlq/inspect with advanced filtering: eventType, retryCount range, time range filtering - Added pagination support with offset and limit - Implemented POST /api/admin/dlq/replay endpoint for selective event replay with safety checks - Replay operations prevent retrying RESOLVED events to avoid infinite loops - Enhanced audit logging for all DLQ operations with detailed filter metadata ### Neurowealth#192 - Rate-limit and auth-failure observability panels - Added Prometheus metrics: rate_limit_hits_total, auth_failures_total, rate_limit_active_violations - Instrumented all rate limiters (global, auth, admin, webhook, internal) to record hits by route group - Added auth failure recording in adminAuth middleware for missing_token, invalid_token, and auth_error types - Metrics track by limiter type and endpoint for granular observability ### Neurowealth#196 - Standardized error-response contract across API routes - Created errorResponse.ts utility with canonical error format - All errors now follow: { error: { code, message, details? }, requestId, timestamp } - Updated error handler middleware to use standardized format - Defined ErrorCodes enum for consistent error categorization - Helper functions for 400, 401, 403, 404, 409, 429, 422, 500, 503 responses ### Neurowealth#193 - Regression tests for critical Prisma-backed flows - Added comprehensive test suite covering session creation/cleanup - Tests for event persistence and cursor updates with unique constraint validation - DLQ write/read/retry flows with status transitions - Admin audit log persistence and retrieval - Tests ensure database integrity and query correctness
f6301d7 to
2a0b3af
Compare
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.
What
Implement advanced DLQ admin tooling with filtering and replay, add rate-limit and auth-failure observability metrics, establish standardized error response contract, and add critical database regression tests.
Issues Resolved
Closes #189
Closes #192
Closes #193
Closes #196
Changes
#189 - Admin tooling for DLQ triage and replay operations
#192 - Rate-limit and auth-failure observability panels
#196 - Standardized error-response contract across API routes
#193 - Regression tests for critical Prisma-backed flows