Skip to content

Commit

Permalink
ref(metrics): Rename tag-field to tags (#3006)
Browse files Browse the repository at this point in the history
It's a list, so the name should reflect that.
  • Loading branch information
TBS1996 authored Jan 26, 2024
1 parent 2624f0c commit 8ef9825
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
## Unreleased

- Add `allow_negative` to `BuiltinMeasurementKey`. Filter out negative BuiltinMeasurements if `allow_negative` is false. ([#2982](https://github.com/getsentry/relay/pull/2982))
- Add ability to block metric tags matching a glob pattern. ([#2973](https://github.com/getsentry/relay/pull/2973))

## 0.8.44

- Add ability to block metrics matching a glob pattern. ([#2954](https://github.com/getsentry/relay/pull/2954))

### Various fixes & improvements

- release: 0.8.43 (9789f00a) by @getsentry-bot
Expand Down
2 changes: 1 addition & 1 deletion relay-dynamic-config/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct TagBlock {
/// Name of metric of which we want to remove certain tags.
pub name: GlobPatterns,
/// Pattern to match keys of tags that we want to remove.
pub tag: GlobPatterns,
pub tags: GlobPatterns,
}

/// Rule defining when a target tag should be set on a metric.
Expand Down
6 changes: 3 additions & 3 deletions relay-server/src/services/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ fn remove_matching_bucket_tags(metric_config: &Metrics, bucket: &mut Bucket) {
if tag_block.name.is_match(&bucket.name) {
bucket
.tags
.retain(|tag_key, _| !tag_block.tag.is_match(tag_key));
.retain(|tag_key, _| !tag_block.tags.is_match(tag_key));
}
}
}
Expand Down Expand Up @@ -1522,7 +1522,7 @@ mod tests {
let metric_config = Metrics {
denied_tags: vec![TagBlock {
name: GlobPatterns::new(vec!["foobar".to_string()]),
tag: GlobPatterns::new(vec![tag_block_pattern.to_string()]),
tags: GlobPatterns::new(vec![tag_block_pattern.to_string()]),
}],
..Default::default()
};
Expand All @@ -1548,7 +1548,7 @@ mod tests {
denied_tags: vec![TagBlock {
// barfoo doesn't batch the 'foobar' bucket
name: GlobPatterns::new(vec!["barfoo".to_string()]),
tag: GlobPatterns::new(vec![tag_block_pattern.to_string()]),
tags: GlobPatterns::new(vec![tag_block_pattern.to_string()]),
}],
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ def test_block_metrics_and_tags(mini_sentry, relay, denied_names, denied_tag):
"sessionMetrics": {"version": 1},
"metrics": {
"deniedNames": [denied_names],
"deniedTags": [{"name": ["*"], "tag": [denied_tag]}],
"deniedTags": [{"name": ["*"], "tags": [denied_tag]}],
},
}
}
Expand Down

0 comments on commit 8ef9825

Please sign in to comment.