feat(backend): audit circuit breaker — Prometheus telemetry, exponent… - #1592
Merged
emdevelopa merged 1 commit intoSep 30, 2026
Conversation
…ial retry, distributed locking, and stress tests (emdevelopa#1433 emdevelopa#1434 emdevelopa#1435 emdevelopa#1436) - emdevelopa#1433: Add prom-client Gauge/Counter/Histogram metrics to AuditCircuitBreaker for state, transitions, failures, successes, open duration, and health checks. Add Prometheus alerting rules (OPEN for >2m, flapping, high failure rate). - emdevelopa#1434: Add execute(fn, options) method with automated exponential backoff retry (baseDelayMs * 2^attempt + jitter), configurable maxRetries and retryableErrors. Export CircuitOpenError. Update audit-writer.js to use execute(). - emdevelopa#1435: Add DistributedAuditCircuitBreakerLock with Redis SET NX PX locking, Lua-guarded release, state sync/publish across instances, and graceful Redis fallback. Add maxConcurrency semaphore to AuditWriterQueue. - emdevelopa#1436: Add integration test suite (10 scenarios) and stress test suite (7 scenarios) covering full state machine, metrics, retry backoff, distributed lock, queue concurrency, and mixed-load circuit behavior. Closes emdevelopa#1433 Closes emdevelopa#1434 Closes emdevelopa#1435 Closes emdevelopa#1436
|
@Judekings is attempting to deploy a commit to the Emmanuel's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Judekings 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.
…ial retry, distributed locking, and stress tests (#1433 #1434 #1435 #1436)
[Backend] Add Prometheus alert metrics and health telemetry to Audit Circuit Breaker #1433: Add prom-client Gauge/Counter/Histogram metrics to AuditCircuitBreaker for state, transitions, failures, successes, open duration, and health checks. Add Prometheus alerting rules (OPEN for >2m, flapping, high failure rate).
[Backend] Implement automated retry with exponential backoff in Audit Circuit Breaker #1434: Add execute(fn, options) method with automated exponential backoff retry (baseDelayMs * 2^attempt + jitter), configurable maxRetries and retryableErrors. Export CircuitOpenError. Update audit-writer.js to use execute().
[Backend] Enhance distributed concurrency control and locking for Audit Circuit Breaker #1435: Add DistributedAuditCircuitBreakerLock with Redis SET NX PX locking, Lua-guarded release, state sync/publish across instances, and graceful Redis fallback. Add maxConcurrency semaphore to AuditWriterQueue.
[Backend] Add comprehensive integration and stress test suite for Audit Circuit Breaker #1436: Add integration test suite (10 scenarios) and stress test suite (7 scenarios) covering full state machine, metrics, retry backoff, distributed lock, queue concurrency, and mixed-load circuit behavior.
Closes #1433
Closes #1434
Closes #1435
Closes #1436