-
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 simple ratio calculation, similar to filter ratio #42385
Comments
@AlonaNadler We talked about this a bunch a while back and you know this thing always trips me up. Do you remember where we kind of settled for the UI of this? Did we want to show an actual equation (numerator / denominator)? I can't seem to find any sketches on my end. |
@AlonaNadler I like your suggestions for "Value Ratio" and "Advanced Ratio" which we discussed offline. "Advanced Ratio" looks a lot like what we've already implemented, so it's easy to implement the changes you've suggested. "Value Ratio" is harder to build, but might be a more important feature. Comments below. "Advanced Ratio": I think your proposal is different in two ways from what we've done with Filter Ratio. We only allowed Filter Ratio on Documents, but you are proposing Document or Field. This is because there's a hidden part of the query that is running a count or other metric on that field/document selection and dividing them. Do you think users are used to building these kinds of hidden/nested queries like in Visualize? Overall I like this a lot, the only thing I would consider changing is whether it's always division- maybe we can support other math? "Value Ratio": I think your proposal is pretty similar to the way that Filters are applied in the navigation, but has more complications because we are also aggregating. It looks like loading a sample of documents for autocomplete is a prerequisite for building Value Ratio. On a query level this one is also more complicated than the Advanced Ratio because we can't nest them nicely- there has to be some kind of flattening. One of the ways we talked about to achieve Value Ratio is using the Terms aggregation and "display as percentage", would that work here? |
Pinging @elastic/kibana-app (Team:KibanaApp) |
I had started some early mocks for this and so far this is what I have. Essentially we can't fit an entire KQL bar in this tiny area so we will need to rely on popovers. The inputs would essentially be readOnly but still have an onClick that opens the popover so you can't edit the input directly. What I don't know is how we want to (by default) represent this via text in the axis label. |
It seems this issue has more information in it whereas #53328 is quite empty. I'd opt for leaving this one open and closing the other.
Depends on what those reusable components are... I don't know the code, I'm just thinking from a UI/UX perspective. We have the opportunity with Lens to rethink the UI for these aggregations. I don't think we should rely on reusable components if it doesn't match the proposed UI. Though it's possible to update those so all usages get improved. |
Yes, I see that this discussion is definitely adding context after reading through it again. To summarize the UX options we have from least knowledge of Elasticsearch to most: a. The user uses a series of menus to enter a filter, which is what's used in the filter editor today I think Alona's preference was for the first option, requiring the least Elasticsearch knowlege. Both A and B are reusable components. |
In the text of this issue, I was trying to compare the current thing that is called "filter ratio" in TSVB against what I think we want to in Lens to solve similar problems. To make this comparison more explicit, I will list out some of the things that we liked about TSVB, and things that we didn't like: Liked about TSVB:
Did not like about TSVB:
Hopefully this will help us focus on defining the problem by breaking it down |
This is possible by using formula - leaving the issue open to track the feature request for a quick function UI for this |
Filter Ratio is a special type of metric that always creates a percentage of based on two sets of documents, for example "failures as a percent of all attempts." The reference implementation in TSVB is missing features, most notably missing support for KQL, and therefore we should make improvements.
Remaining open questions
Implementation
All implementations of filter ratio in Lens depend on the App Arch team. Our preference is to implement this as a calculation using filtered metrics and math, making this a shortcut function. Shortcut functions let users achieve the same results multiple ways.
Prior edits
We previously attempted to implement a filter ratio in Lens, which we removed for both technical and user experience reasons. This screenshot showed our original implementation of filter ratio in Lens. It only supported "Count of documents." It hides the denominator query by default, and was generally confusing.
The text was updated successfully, but these errors were encountered: