Repository navigation
Count each request once and backend 5xx as failures - #267
Merged
Merged
Conversation
… translator stats
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Summary
Stats counted a request that named a model twice (since v0.0.29), and counted a backend 5xx as a success. For example, 10 requests with 4 backend 503s showed 20 total / 0 failures / 100%; they now show 10 / 4 / 60%. A backend 4xx, 429 included, still counts as a success.
Behaviour change: failure counts rise, so failure-count alerts start firing. Affected surfaces:
/internal/status,/internal/metrics,/internal/stats/models,/internal/stats/translatorsand the dashboard. The client response, failover and circuit breaker behaviour are unchanged.What changed
internal/adapter/proxy/core/base.go: single place that records the outcome, with 5xx treated as failed.internal/adapter/stats/collector.go: request and endpoint counters no longer double count; model and translator stats follow the same rule.internal/adapter/proxy/olla/service_retry.goandinternal/adapter/proxy/sherpa/service_retry.go: both engines record per backend attempt.internal/app/handlers/handler_translation.go: translator stats (passthrough and translation) count a 5xx as a failure.Type of change
How was this tested?
make readyandmake ci-webpassed on a trial merge of this branch with main (aa990f7).Checklist
make readypasses (test-short + test-race + fmt + vet + lint + align)./docs) if behaviour or config changed