-
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
[aggregator] Add compatibility for rollup rules with timed metrics #2251
Conversation
|
||
// IncValuesOutOfOrder increments value or if not initialized is a no-op. | ||
func (m CounterMetrics) IncValuesOutOfOrder() { | ||
if m.valuesOutOfOrder != nil { |
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.
Do we expect to initialize a CounterMetrics
without the constructor or is this just to be paranoid?
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.
Bit of both, I believe some integration tests do not initialize it and also this is for paranoia.
// NB: we only need to record the value needed for derivative transformations. | ||
// We currently only support first-order derivative transformations so we only | ||
// need to keep one value. In the future if we need to support higher-order | ||
// derivative transformations, we need to store an array of values here. | ||
e.lastConsumedValues[aggTypeIdx] = value | ||
if !math.IsNaN(curr.Value) { |
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.
Discussed offline why we bother passing evaluating the op if incoming sample is NaN but there may be transformations (such as count # samples) that still care.
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.
👍
src/aggregator/aggregator/entry.go
Outdated
if sm.Tombstoned { | ||
e.RUnlock() | ||
timeLock.RUnlock() | ||
// e.metrics.timed.tombstonedMetadata.Inc(1) |
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.
Undo comment?
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.
Ah good call.
src/aggregator/aggregator/entry.go
Outdated
if len(sm.Pipelines) == 0 { | ||
e.RUnlock() | ||
timeLock.RUnlock() | ||
e.metrics.untimed.noPipelinesInMetadata.Inc(1) |
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.
s/untimed/timed/
?
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.
Yup, ty good call.
src/metrics/transformation/binary.go
Outdated
diff := curr.Value - prev.Value | ||
if diff < 0 { | ||
// // Treated as a counter reset, take the curr value as counted elements. | ||
// return Datapoint{TimeNanos: curr.TimeNanos, Value: curr.Value} |
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.
Stale comment
fix integration test fix integration test fix Add metrics for passthrough in follower instances [aggregator] Add compatibility for rollup rules with timed metrics (#2251) Add pass-through in m3aggregator using rawtcp server fix
What this PR does / why we need it:
Adds compatibility for rollup rules to the aggregator with timed metric types.
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?: