-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[coordinator] Only honor default aggregation policies if not matched by mapping rule #2203
[coordinator] Only honor default aggregation policies if not matched by mapping rule #2203
Conversation
…atch-configured-mapping-rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with couple of spelling errors.
Codecov Report
@@ Coverage Diff @@
## master #2203 +/- ##
======================================
Coverage 71.5% 71.5%
======================================
Files 1022 1022
Lines 88961 88961
======================================
Hits 63693 63693
Misses 20908 20908
Partials 4360 4360
Continue to review full report at Codecov.
|
// NB(r): First apply mapping rules to see which storage policies | ||
// have been applied, any that have been applied as part of | ||
// mapping rules that exact match a default storage policy will | ||
// skipped when applying default rules so to avoid storing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; be skipped
, rules, so as
debugLogMatchOptions{Meta: stagedMetadatas}) | ||
|
||
// Only sample if going to actually aggregate | ||
stagedMetadatsBeforeFilter := stagedMetadatas[:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: stagedMetadataBeforeFilter
for _, existing := range a.mappingRuleStoragePolicies { | ||
if sp.Equivalent(existing) { | ||
matchedByMappingRule = true | ||
a.debugLogMatch("downsampler skipping default mapping rule storage policy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also log exactly which rule was skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might get confusing since it could be a subsection of it - thankfully we print that out just as we start matching it (so its contextually close in the logs)
a.debugLogMatch("downsampler applying default mapping rule",
debugLogMatchOptions{Meta: stagedMetadatas})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved w/nits
…atch-configured-mapping-rules
…atch-configured-mapping-rules
What this PR does / why we need it:
After seeing mapping rules in use, it's become obvious that default aggregations should not honored if a matching mapping rule already specifies an aggregation for the same storage policy (retention + resolution). Letting both apply will cause race conditions on which aggregated value makes it to storage with the same metric name and tags.
This keeps the current behavior as is however will remove any applicable default aggregations for aggregated namespaces defined if a mapping rule has already been applied for the given storage policy (retention + resolution).
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: