enhancement(tag_cardinality_limit transform): add exclude_tags option to bypass cardinality limiting#25316
Open
kaarolch wants to merge 10 commits intovectordotdev:masterfrom
Open
enhancement(tag_cardinality_limit transform): add exclude_tags option to bypass cardinality limiting#25316kaarolch wants to merge 10 commits intovectordotdev:masterfrom
kaarolch wants to merge 10 commits intovectordotdev:masterfrom
Conversation
Contributor
Author
|
btw. we can optimized redundant scans of
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da116e6bac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
This reverts commit aee2a7f.
Draft
9 tasks
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
Adds a new
exclude_tagsoption to thetag_cardinality_limittransform. Tag keys listed inexclude_tagsbypass cardinality limiting entirely: they are passed through unchanged on every event, are not counted against metricvalue_limit, and never enter the cache.The option can be set globally and/or per-metric (via
per_metric_limits.<name>); when both are set, theeffective exclusion list is the union of the two. This is useful for tags whose high cardinality is intentional and must be preserved, such as
kube_pod_nameortenant_id, while still bounding the cardinality of other tags on the same metric.Why
Closes #20972. Similar to @btkostner we have multiple scenarios when most of metric tags should be protected by cardinality tags transform but there are bunch of tags what should be always bypassed.
Vector configuration
Per metric name example:
How did you test this PR?
Unit tests (added in src/transforms/tag_cardinality_limit/tests.rs):
These cover both Exact and Probabilistic modes, both limit_exceeded_action values (drop_tag and drop_event), and the global + per-metric union semantics.
cargo test -p vector --lib transforms::tag_cardinality_limitLocal verification commands run from the repo root:
Local verification commands:
E2E test with the config above and a small Python sender (stdlib only) that publishes one measurement carrying six tag keys per request — service, env (constant), kube_pod_name (excluded, varies), and region / instance / version (not excluded, vary):
Change Type
Is this a breaking change?
The new field defaults to an empty list (#[serde(default)]), so existing configurations behave exactly as before.
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make testgit merge origin masterandgit push.Cargo.lock), pleaserun
make build-licensesto regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.