feat(#770): add provider health registry and degradation status - #896
Open
frankrichard99 wants to merge 1 commit into
Open
feat(#770): add provider health registry and degradation status#896frankrichard99 wants to merge 1 commit into
frankrichard99 wants to merge 1 commit into
Conversation
- Add ProviderHealthRegistry with rolling-window failure tracking - Add /v1/ai/health/providers public endpoint (no secrets leaked) - Add /v1/ai/health/providers/detail operator endpoint - Integrate health recording into OpenAI/Groq provider calls - Add provider health Prometheus metrics - Cover provider-down and recovery behavior with tests Closes Pulsefy#770
|
@frankrichard99 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.
Closes #770
This PR adds a centralized provider health registry that tracks recent failures
and exposes degraded/fallback status without leaking sensitive details.
New files:
services/provider_health.py— Thread-safe health registry with rolling-windowfailure tracking, circuit-breaker integration, and aggregate status computation
api/v1/health.py— Two endpoints: public/v1/ai/health/providers(no secrets)and operator
/v1/ai/health/providers/detail(with internal counters)tests/test_provider_health.py— 20+ tests covering recording, circuit states,error rates, rolling windows, thread safety, clear/reset
tests/test_health_endpoint.py— 15+ tests covering endpoint shape, secretleakage prevention, degraded/down states, recovery, detail endpoint
Modified files:
api/v1/router.py— Wired health router into v1services/providers.py— Records failures/successes during LLM callsmetrics.py— Added provider health gauges/countersTest results: All new and existing tests pass.