Add IncludeTags to R2 Rollup Options #4277
Merged
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.
What this PR does / why we need it:
To add new reserved metric tags, we need to add the reserved tag to the initial metric id, and the rollup id otherwise the reserved tag will be lost during the R2 rollup process. Currently to do this, we would need to manually update the R2 rules to filter for the new reserved tag. However, this is a time consuming process because we need to update all R2 rules in the repo to ensure the reserved tag is added to all rollup ids.
To address this issue, in the matcher config, I added functionality to specify a list of "include tags" which are tags that if seen in the metric id, we should add to the rollup id. So if the metric id contains a reserved tag that needs to be added to the rollup id, the forward matching logic will add the reserved tag to the rollup id.
In the future, if there are more reserved tags that R2 forward match should add to rollup ids, we should add those tags in the include tags config.
This PR is an exact copy of a PR I made from my forked repo, however the buildkite check doesn't run on forked repos so making the PR on the main repo: #4270.