-
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] Compare against time offsets #68458
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
There are at least four ways that I can imagine this data being visualized:
This implies that every time the user wants to add a time offset, we will add three calculated columns which are supported by the Lens editor. These columns will need to act like references which will behave differently than our current query-building model. This requires some product and design input @AlonaNadler @cchaos The user flow I'm imagining is basically the same in all the visualizations we support. There are two main examples: XY visualization:
Metric visualization:
|
I see the comparison feature in the following way. I think we need a dedicated option for comparison that can apply to any calculation (average, sum, complex future calculation etc..)
once choosing the interval allow them to show the comparison calculation based on the same function (average, sum, complex future calculation etc..) or as a percentage change (might be other options here) |
@AlonaNadler that sounds very much like what I proposed above. It seems like you were wondering about how this would work with any existing features, which I was trying to show above. To say it again in a different way: the way time offsets should work is on the entire layer/query. Internally, we are going to create a copy of the query with with different filters. This approach will work with any query. |
Sounds good @wylieconlon.
Second option:
This approach also allows to delete the original calculation, need to figure how to change the calculation (I want to change it to sum(CPU) or the average of bytes) |
Sounds like there are multiple possible ways of presenting these forms to the user. To focus on the user experience, we should consider how the user would create all 4 visualizations that I wrote above:
As long as the user can do all 4 of these, I think we'll have a good design. |
If these are calculated within the visualization; how will they interact with alerting? For example, alert me when day/day exceeds a certain value. |
@VijayDoshi We don't support alerting from any of the visualizations in Kibana, so I don't see how that question is related to this. |
@wylieconlon We will eventually support alerting, right? Are we building something we'll just have to revisit once we decide to add alerting, can we prevent that? |
@VijayDoshi Alerting is not in our Lens GA roadmap, and in fact hasn't been discussed in the context of Lens at all. My intuition is that there is no conflict because alerting will use expressions, and so does Lens. If you want to discuss it in more detail, please open an issue for the topic of alerting in Lens. |
@wylieconlon added #71150 to evaluate Alerting from Lens Visualizations. |
@cchaos @flash1293 I've been thinking about how this feature should work, and have made two videos to show you my thoughts. As a reminder of the goal of the time offsets, users should be able to create charts like this which shows current, previous, and percent difference for time offsets: I would be comfortable going in either of the two directions shown by these videos:
|
I think I like the dimension setting because it allows you to do everything within in a single place without switching context and is a better fit for using time-shifted values in math operations (which is a common use case I think) |
The esaggs query setting has been put on the @elastic/kibana-app-arch roadmap. I think there is not a lot of ambiguity left in terms of the implementation of this feature, except for the dependency on the esaggs implementation. |
+1 time series visual builder has this capability and it's used extensively within our customer base. |
It's important to note that this feature would be more powerful than what TSVB offers because we would also support calculations across time periods- in TSVB you can only view data with different offsets, but you can't subtract the two series or divide the series. |
in addition to edit: okay you just type |
As part of my work on the UI for defining calculations, I have considered the role of time offsets such as month over month as it applies to our visualizations (including visualizations that don't support layers). Specifically, I propose that the Lens editor can add additional columns with a time offset to any visualization that supports time. To give a simple example, let's consider the
Top 3 categories this week
query, which returns:Now I want to compare these numbers to the previous week, so I click the "Add time offset" button, and say "1 month". The final table is now:
What the Lens editor has done is create a new datasource layer with a different context, and executed what is commonly called a
FULL OUTER JOIN
in SQL terminology. The visualization doesn't need to know where the data came from, it just needs to be provided with a set of column definitions.Doing time shifting on date histograms
One of the common use cases for this is to use time shifting to compare something like "today at 12pm" to "one week ago at 12pm". The
FULL OUTER JOIN
wouldn't match the dates in the date histogram. The simplest approach is to use a library like moment to add the time interval to each date field in the results. It's about as good as we can do, but there might still be some degenerate cases like leap days or daylight saving time. A good example is:Which time offsets should we support?
I would propose that we keep this to a simple list of mostly easy-to-divide intervals
Dependencies
Esaggs: #71287
The text was updated successfully, but these errors were encountered: