Repository navigation
Sample repeated rejection logs so one client can't flood the log - #237
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis change adds bounded sampling for repeated rejection logs across security validators, request logging, proxy routing, and dashboard access. It preserves rejection responses and security violation metrics, adds summary flushing during shutdown, and documents the logging behaviour. ChangesRejection-log sampling
Priority: Estimated code review effort: 4 (Complex) | ~60 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Client
participant CombinedLoggingMiddleware
participant Handler
participant Throttle
participant StyledLogger
Client->>CombinedLoggingMiddleware: Send request
CombinedLoggingMiddleware->>Handler: Pass request
Handler-->>CombinedLoggingMiddleware: Return response
CombinedLoggingMiddleware->>Throttle: Check Olla rejection key
Throttle-->>CombinedLoggingMiddleware: Allow or suppress log
CombinedLoggingMiddleware->>StyledLogger: Write allowed rejection log
Throttle->>StyledLogger: Report suppressed count
Possibly related PRs
Merge Risk:
|
# Conflicts: # docs/content/about/release-notes.md
This was referenced Oct 27, 2026
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
Olla logged one or more WARN/ERROR lines for every request it rejected itself. One client hammering it produced 13.7M lines in 10 minutes.
Each rejection is now sampled per key. The first one in a 10s window is logged in full, then one
repeats suppressedline carriessuppressed=N. Sampled rejections:status|client;MaxBytesError).These per-request duplicates are gone or moved to Debug:
Model routing rejected request;Large request blocked;Tracking stays small:
strings.Clone;Allow, with no goroutines;Backend 4xx/5xx responses (those with
X-Olla-Endpoint) are never sampled. Non-test code is about +540/-85; the rest is tests.Type of change
How was this tested?
Tests cover each layer, using a fake clock:
ThrottleandThrottleSet;MetricsAdapter, a mixed-reason case and a distinct-IP storm;MaxBytesError, a longX-Forwarded-For, andTestTranslationHandler_StrictRejectionFloodLogsBoundedwith 0 ERROR lines over 300 rejections;Each behavioural test fails with its fix reverted.
Live run on
integration/test-octoberat85f9244, re-checked atc9d134c:suppressed=494.Checklist
make readypasses at7e911a3configuration/practices/security.md"Rejection Log Sampling", plus the v0.0.30 release noteOut of scope:
/olla/anthropic/v1/messages, "No compatible endpoints found for path, falling back to all endpoints". It's logged for every request there, not just rejections, so it's tracked separately.Summary by CodeRabbit
New Features
Bug Fixes