Skip to content
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] Allow use of top metric for last value #102956

Closed
flash1293 opened this issue Jun 22, 2021 · 3 comments · Fixed by #127151
Closed

[Lens] Allow use of top metric for last value #102956

flash1293 opened this issue Jun 22, 2021 · 3 comments · Fixed by #127151
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

flash1293 commented Jun 22, 2021

Right now Lens is using top hits to power the last value function. However, this has a major downside - it's not possible to sort a terms agg by a top hits agg (it's also less efficient).

By using top metrics instead of top hits, we could use sorting and also provide better performance, but it has a downside as well - array values are not supported, something we offer in the current version of last value.

Previous discussion: #98733

Absent a better solution, to offer the best possible feature, we should offer a choice in the UI:

  • Implement top metric as an agg type so it's possible to use it
  • By default, compile last value to top metric and mark it as sortable
  • In the last value dimension configuration provide a switch "show array values" (wording tbd), to switch it over to top hits (set to true by default for existing visualizations)
  • If the selected field is a scripted field, do not allow to disable "show array values" (always use top hits)
  • If possible (top metrics is used) include the last value dimension in the regular top values ranking logic
@flash1293 flash1293 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jun 22, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor Author

@Dosant Is there an issue to point to for the planned "top metric" work on the app services side?

@Dosant
Copy link
Contributor

Dosant commented Feb 11, 2022

@flash1293 here it is: #124535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants