Skip to content

Commit 2ab0c0f

Browse files
committed
Update docs/comments
1 parent 68fe2f2 commit 2ab0c0f

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
@@ -143,8 +143,9 @@ pub struct PerMetricConfig {
143143
/// - `mode: limit_override` + `value_limit: N` — track with a per-tag cap.
144144
/// - `mode: excluded` — opt this tag out of tracking entirely.
145145
///
146-
/// All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
147-
/// are inherited from the enclosing per-metric configuration.
146+
/// All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
147+
/// are inherited from the enclosing per-metric configuration, except
148+
/// `cache_size_per_key`, which can be overridden per tag in probabilistic mode.
148149
/// Tags not listed here use the per-metric configuration.
149150
#[configurable(
150151
derived,
@@ -379,7 +380,7 @@ impl Config {
379380
}
380381

381382
// Per-metric per_tag_limits: cache_size_per_key only applies when the per-metric
382-
// mode is probabilistic (not exact, and not excluded).
383+
// mode is probabilistic.
383384
for per_metric in self.per_metric_limits.values() {
384385
if !matches!(per_metric.config.mode, OverrideMode::Probabilistic(_)) {
385386
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
@@ -154,7 +154,8 @@ generated: components: transforms: tag_cardinality_limit: configuration: {
154154
- `mode: excluded` — opt this tag out of tracking entirely.
155155
156156
All other settings (tracking algorithm, `limit_exceeded_action`, etc.)
157-
are inherited from the enclosing per-metric configuration.
157+
are inherited from the enclosing per-metric configuration, except
158+
`cache_size_per_key`, which can be overridden per tag in probabilistic mode.
158159
Tags not listed here use the per-metric configuration.
159160
"""
160161
required: false

0 commit comments

Comments
 (0)