-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Add reduced time range option #136706
Conversation
Thanks for taking a look, @KOTungseth
Unfortunately this is conceptually something very different than the interval of the date histogram - they are the same in the sense that they both describe a time duration, but the window option is about defining the window of time that should be considered at all for this aggregation while the interval is about slicing the whole time range into even buckets. I'm concerned users would try to configure the actual date histogram interval within the metric configuration because it uses the same name. Open to find a better word than "window", but it should be clear what this is about. There is no default value for the window - by default, no window is applied and data from the whole time range (the one configured in the top right) is taken into account |
Agree with @flash1293 that My bad ideas:
maybe they provoke something? |
I agree that it’s very “filtery” but it’s also closely related to the time range. What about “Reduced time range” with a description below the input “Additional time range filter aligned with the end of the global time range”? |
nice - that sounds pretty good to me. |
How about:
|
Noting down the things discussed: We were also pushing this around a bit in our sync a bit, but we didn't come to a good conclusion. The biggest problem with "Reduce time range" is that it doesn't make it obvious this reduced time range is aligned with the end of the global time range. I think it's important to keep it in there somehow. Do you have an idea for that, @KOTungseth ? |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
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.
Great addition! This works great, LGTM! I find the term Reduced time range a very good choice and with a small help from the description is easy to understand what this is for. 👍
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.
Only read the code, overall changes LGTM great work @flash1293
I know it's getting late but this I think amends @KOTungseth's text to account for that extra piece of info |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: |
Fixes #132112
This PR adds a "reduced time range" option to all metrics operations - if applied, only values which are within the specified window (anchored at the end of the selected time range) are aggregated for the final metric. The window is specified in the same way as the time shift interval, but without any restrictions.
The label is adjusted automatically when the window changes
It can be applied together with time shift - in this case the window is shifted in the same way as the base time range.
This option can't be applied if a date histogram is used (Once TSDB sliding window lands, it can be translated into using sliding window but at the moment Elasticsearch can't handle this functionality) or if the current data view doesn't have a default time field (because there isn't a reference time frame to anchor the interval in this case).
This does not work for counter rate, as the Lens counter rate can only be used with a date histogram which is incompatible with the window filter without TSDB support. However, it can be done using a formula even today with these features:
Growth rate per second of my_counter_field in the last 5 mins as a metric
Once TSDB aggs land, it will be a simple "Sum of my_counter_field with a window of 5m"
Implementation
On Lens side this is implemented similar to the time shift option.
On AggConfig side this is part of the existing
filter
agg config - it takes a window and translates it into a filter based on the current time range and the default time field of the index pattern.