Skip to content

Commit 3536cf6

Browse files
committed
Update docs/comments
1 parent 74f059a commit 3536cf6

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/transforms/tag_cardinality_limit/config.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ pub struct PerMetricConfig {
136136
/// - `mode: limit_override` + `value_limit: N` — track with a per-tag cap.
137137
/// - `mode: excluded` — opt this tag out of tracking entirely.
138138
///
139-
/// All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
140-
/// are inherited from the enclosing per-metric configuration.
139+
/// All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
140+
/// are inherited from the enclosing per-metric configuration, except
141+
/// `cache_size_per_key`, which can be overridden per tag in probabilistic mode.
141142
/// Tags not listed here use the per-metric configuration.
142143
#[configurable(
143144
derived,
@@ -368,7 +369,7 @@ impl Config {
368369
}
369370

370371
// Per-metric per_tag_limits: cache_size_per_key only applies when the per-metric
371-
// mode is probabilistic (not exact, and not excluded).
372+
// mode is probabilistic.
372373
for per_metric in self.per_metric_limits.values() {
373374
if !matches!(per_metric.config.mode, OverrideMode::Probabilistic(_)) {
374375
for (tag_key, tag_cfg) in &per_metric.per_tag_limits {

src/transforms/tag_cardinality_limit/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ impl TagCardinalityLimit {
9696
/// Resolve the configuration that applies to a specific (metric, tag) pair.
9797
///
9898
/// Per-tag entries support two modes:
99-
/// - `mode: limit_override` — uses the per-tag `value_limit`; all other settings
100-
/// (`mode`, `cache_size_per_key`, `limit_exceeded_action`, `internal_metrics`)
101-
/// are inherited from the enclosing per-metric (or, for global overrides, the
102-
/// global) config.
99+
/// - `mode: limit_override` — uses the per-tag `value_limit` and an optional per-tag
100+
/// `cache_size_per_key`; all other settings (`mode`, `limit_exceeded_action`,
101+
/// `internal_metrics`) are inherited from the enclosing per-metric (or, for global
102+
/// overrides, the global) config.
103103
/// - `mode: excluded` — opts the tag out entirely; all values pass through.
104104
///
105105
/// Per-metric exclusion is blanket: `mode: excluded` on a per-metric entry opts out
@@ -132,8 +132,9 @@ impl TagCardinalityLimit {
132132
let metric_value_limit = per_metric.config.value_limit;
133133
let internal_metrics = per_metric.config.internal_metrics;
134134

135-
// Per-tag entry: LimitOverride uses an explicit value_limit; Excluded opts
136-
// the tag out. All other settings are always inherited from per-metric.
135+
// Per-tag entry: LimitOverride uses an explicit value_limit (and optional
136+
// cache_size_per_key override); Excluded opts the tag out. All other settings
137+
// are always inherited from per-metric.
137138
if let Some(per_tag) = per_metric.per_tag_limits.get(tag_key) {
138139
match per_tag.mode {
139140
PerTagMode::Excluded => return TagSettings::Excluded,

website/cue/reference/components/transforms/generated/tag_cardinality_limit.cue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ generated: components: transforms: tag_cardinality_limit: configuration: {
146146
- `mode: excluded` — opt this tag out of tracking entirely.
147147
148148
All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
149-
are inherited from the enclosing per-metric configuration.
149+
are inherited from the enclosing per-metric configuration, except
150+
`cache_size_per_key`, which can be overridden per tag in probabilistic mode.
150151
Tags not listed here use the per-metric configuration.
151152
"""
152153
required: false

0 commit comments

Comments
 (0)