feat(vlinsert): add vlinsert stream field limit#1
Open
bearslyricattack wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional per-stream-label value row limiter to the Loki JSON ingest path in vlinsert, preventing more than N log rows per configured label value within a time window.
Changes:
- Introduces
app/vlinsert/streamfieldlimitpackage implementing a sharded in-memory windowed row limiter driven by CLI flags. - Applies the limiter during Loki JSON request parsing to drop rows beyond the per-value quota.
- Adds unit tests for the limiter itself and an integration-style test for Loki JSON parsing with the limiter enabled.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/vlinsert/streamfieldlimit/limiter.go | New sharded, windowed row limiter with flag-based configuration. |
| app/vlinsert/streamfieldlimit/limiter_test.go | Unit tests for limiter behavior and window reset. |
| app/vlinsert/loki/loki_json.go | Integrates limiter into Loki JSON parsing to cap ingested rows per configured label value. |
| app/vlinsert/loki/loki_json_test.go | Adds coverage validating row dropping behavior when the limiter is enabled. |
zijiren233
requested changes
Jun 11, 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.
No description provided.