You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add dead-letter alarm and route for inspecting failed webhook deliveries
Why this matters
WebhookQueue in src/index.ts marks exhausted deliveries as dead_letter in webhook_deliveries, but there is no metric, alarm, or operator-facing route to surface them, so failed customer integrations go unnoticed. Expose a dead_letter count gauge per endpoint and an admin route returning the most recent dead-lettered deliveries for inspection and replay.
Scope
Implement the requested behavior across src/index.ts, src/db/repositories/webhookEndpointRepository.ts, src/routes/webhooks.ts, GET /admin/webhooks/:endpointId/dead-letters, POST /admin/webhooks/dead-letters/:id/replay. The solution must preserve existing compatibility, authorization, and production safeguards.
Priority
High
Acceptance criteria
The requested behavior is implemented across src/index.ts, src/db/repositories/webhookEndpointRepository.ts, src/routes/webhooks.ts, GET /admin/webhooks/:endpointId/dead-letters, POST /admin/webhooks/dead-letters/:id/replay with a clear, reviewable contract.
Security, authorization, validation, and data-integrity requirements in the repository context are enforced and covered by tests.
Failure, retry, timeout, concurrency, and boundary behavior is explicit and produces safe, diagnosable outcomes where applicable.
Regression coverage includes empty, invalid, duplicate, and boundary inputs relevant to this flow.
Existing API, storage, and deployment compatibility is preserved unless a migration is explicitly documented.
Validation
Include focused tests for:
happy paths;
invalid input and authorization boundaries;
concurrency, retries, or failure recovery;
backward compatibility;
relevant integration or contract behavior.
The implementation must pass the repository’s existing build, lint, test, and formatting checks (use npm test where applicable).
Non-goals
Typo-only, formatting-only, or documentation-only changes.
Unrelated refactors or dependency upgrades.
Weakening security, authorization, CI, or production safeguards.
Changing public behavior outside this issue’s scope.
Contributor application
Before implementation, comment with:
relevant experience;
a concise implementation approach;
expected files or modules affected;
an estimate for opening the first PR.
Wait for maintainer assignment before coding.
PR requirements
Use a feature branch and include Closes #.
The PR must:
address every acceptance criterion;
link each criterion to code and tests;
explain security and failure-mode handling;
include meaningful regression coverage;
document compatibility or migration considerations;
pass the repository checks.
Reward-readiness
This is a substantive quality issue. Merge status does not guarantee reward eligibility; final evaluation is determined separately.
Implementation context
Description
WebhookQueue in src/index.ts marks exhausted deliveries as dead_letter in webhook_deliveries, but there is no metric, alarm, or operator-facing route to surface them, so failed customer integrations go unnoticed. Expose a dead_letter count gauge per endpoint and an admin route returning the most recent dead-lettered deliveries for inspection and replay.
Summary
Add dead-letter alarm and route for inspecting failed webhook deliveries
Why this matters
WebhookQueueinsrc/index.tsmarks exhausted deliveries asdead_letterinwebhook_deliveries, but there is no metric, alarm, or operator-facing route to surface them, so failed customer integrations go unnoticed. Expose adead_lettercount gauge per endpoint and an admin route returning the most recent dead-lettered deliveries for inspection and replay.Scope
Implement the requested behavior across src/index.ts, src/db/repositories/webhookEndpointRepository.ts, src/routes/webhooks.ts, GET /admin/webhooks/:endpointId/dead-letters, POST /admin/webhooks/dead-letters/:id/replay. The solution must preserve existing compatibility, authorization, and production safeguards.
Priority
High
Acceptance criteria
Validation
Include focused tests for:
The implementation must pass the repository’s existing build, lint, test, and formatting checks (use npm test where applicable).
Non-goals
Contributor application
Before implementation, comment with:
Wait for maintainer assignment before coding.
PR requirements
Use a feature branch and include Closes #.
The PR must:
Reward-readiness
This is a substantive quality issue. Merge status does not guarantee reward eligibility; final evaluation is determined separately.
Implementation context
Description
WebhookQueueinsrc/index.tsmarks exhausted deliveries asdead_letterinwebhook_deliveries, but there is no metric, alarm, or operator-facing route to surface them, so failed customer integrations go unnoticed. Expose adead_lettercount gauge per endpoint and an admin route returning the most recent dead-lettered deliveries for inspection and replay.Requirements and context
src/index.ts(WebhookQueue),src/db/repositories/webhookEndpointRepository.ts,src/routes/webhooks.tsevent_idSuggested execution
git checkout -b feat/webhook-dead-letter-routewebhook_dead_letter_total{endpoint}to the metrics collectorGET /admin/webhooks/:endpointId/dead-letterslisting recent failuresPOST /admin/webhooks/dead-letters/:id/replaythat re-enqueues idempotentlyTest and commit
npm testevent_id, non-admin returns 403, pagination guard, cardinality cap on endpoint labelExample commit message
feat: expose webhook dead-letter inspection and replayGuidelines