Skip to content

Commit ab09426

Browse files
committed
fix(o11y): add RAR remapper rule for aggregator.filtered_tags (#1823)
## Summary Adds a RAR remapper rule mapping `adp.tag_filterlist_tags_filtered_total{component_id:dsd_tag_filterlist}` to `aggregator.filtered_tags`, the Core Agent equivalent that tracks how many tags were removed from metric samples by the tag filter. ## Test plan - [ ] `cargo test -p agent-data-plane` — remapping output and help text tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com>
1 parent 7ecb8f5 commit ab09426

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

bin/agent-data-plane/src/state/metrics/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,13 @@ mod tests {
823823
Context::from_static_parts("adp.tag_filterlist_updates_total", &["component_id:dsd_tag_filterlist"]),
824824
11.0,
825825
)),
826+
Event::Metric(Metric::counter(
827+
Context::from_static_parts(
828+
"adp.tag_filterlist_tags_filtered_total",
829+
&["component_id:dsd_tag_filterlist"],
830+
),
831+
23.0,
832+
)),
826833
];
827834

828835
for metric in metrics {
@@ -839,6 +846,7 @@ mod tests {
839846
assert!(output.contains("aggregator__dogstatsd_filtered_metrics 7"));
840847
assert!(output.contains("tag_filterlist__size 9"));
841848
assert!(output.contains("tag_filterlist__updates 11"));
849+
assert!(output.contains("aggregator__filtered_tags 23"));
842850
assert!(!output.contains("datadog__agent__filterlist__size"));
843851
assert!(!output.contains("datadog__agent__filterlist__updates"));
844852
assert!(!output.contains("datadog__agent__dogstatsd__listener_filtered_points"));
@@ -895,5 +903,9 @@ mod tests {
895903
get_help_text("tag_filterlist.updates"),
896904
Some("Incremented when a reconfiguration of the tag filterlist happened")
897905
);
906+
assert_eq!(
907+
find("aggregator.filtered_tags"),
908+
Some("How many tags were filtered from a metric sample")
909+
);
898910
}
899911
}

bin/agent-data-plane/src/state/metrics/rules/dogstatsd.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ pub fn get_dogstatsd_remappings() -> Vec<RemapperRule> {
3333
&["component_id:dsd_tag_filterlist"],
3434
"tag_filterlist.updates",
3535
),
36+
RemapperRule::by_name_and_tags(
37+
"adp.tag_filterlist_tags_filtered_total",
38+
&["component_id:dsd_tag_filterlist"],
39+
"aggregator.filtered_tags",
40+
)
41+
.with_help_text("How many tags were filtered from a metric sample"),
3642
RemapperRule::by_name_and_tags(
3743
"adp.object_pool_acquired",
3844
&["pool_name:dsd_packet_bufs"],

0 commit comments

Comments
 (0)