-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add max_over_time aggregation for TSDB #126498
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
Conversation
3ae9557 to
8951ed4
Compare
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
| QUERY_MONITORING; | ||
| QUERY_MONITORING, | ||
|
|
||
| MAX_OVER_TIME(Build.current().isSnapshot()); |
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: add explanatory comment as the rest of the entries.
| * | STATS sum(`rate(request)`), `min(memory_used)` = from_partial($p1, min($)) BY pod=`VALUES(pod)`, `bucket(@timestamp, 5m)` | ||
| * | KEEP `min(memory_used)`, `sum(rate(request))`, pod, `bucket(@timestamp, 5m)` | ||
| * | ||
| * _over_time time-series aggregation will be rewritten in the similar way |
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: {agg}_over_time
| * becomes | ||
| * | ||
| * TS k8s | ||
| * | STATS max(memory_usage), VALUES(host) BY _tsid, bucket(@timestamp, 1minute) |
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.
Maybe: | STATS max_memory_usage=max(memory_usage), VALUES(host) BY _tsid, bucket(@timestamp, 1minute)
to reference it below?
kkrik-es
left a 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.
Awesome, it's really nice to see this getting generalized so easily. We can add the rest with minimal effort, too.
martijnvg
left a 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.
Thanks Nhat, this approach looks very clean 👍
|
@kkrik-es @martijnvg Thanks :) |
This change adds support for the
max_over_timeaggregation for time_series indices. Similar to therateaggregation, this aggregation is translated into two stages: the first stage groups by_tsid(and time-bucket), and the second stage groups by the user-specified groups.For example:
is translated into:
In this case, we don't need to keep the Lucene source emitted in the order of _tsid/timestamp, but I leave this optimization for the future.
Other
*_over_timefunctions will be added later.