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] Automatically enable show array values for non-numeric runtime fields #149025
Conversation
Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations) |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Works well. I understand that this is quite an edge case so I'm not sure how much effort it's worth to polish it. That said, have you considered disabling the toggle in this case? I'm not sure why it's useful to the user to be able to turn show array values off when we know it's going to cause an error.
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.
This works fine, it seems from the documentation that top metrics doesn't work well with array values https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-metrics.html so it makes sense to me.
The error message is very confusing though. We can improve the UI either with a better error message or following Andrew's suggestion. I don't have a preference. With that being said, I am fine as it is now, we can always see if this confuses our users and improve.
On one hand that would make it easier to maintain, on the other hand if user knows the runtime field is not returning an array, then they would pay a perf toll for the request.
I agree the error message is very confusing, but fixing it properly requires quite some code to add - as for the linked closed PR - which I would delay right now. |
Agree, let's merge |
Summary
Fixes #148613
After investigating the issue via a different approach #149011 I've decided to handle it in this minimal way.
This PR will automatically switch the
show_array
toggle for non numeric fields avoiding as much as possible direct appearance of the error to the user.If the user decides to explicitly disable the toggle, then the runtime error will be shown (the message there can still be improved).
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers