elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

[Lens] allow rendering despite invalid dimensions/layers #144906

Open drewdaemon opened 2 years ago

drewdaemon commented 2 years ago

Describe the feature

Today in many cases Lens will not render a chart because of a single invalid dimension or layer. The rest of the chart configuration may be perfectly valid and if the problematic portion of the configuration were ignored, we could still show the user a partial chart while still signaling the problem with this dimension-local pattern we use for reference lines:

Screen Shot 2022-11-09 at 9 52 47 AM

This would make for a better user experience than we have today since

We could also make the error icon mutually exclusive with the existing swatch/collapsed/palette dimension icon.

Specific use cases

Questions

Related questions

Technical thinking

This change would involve allowing the visualization class to mark certain dimensions as invalid for all purposes (including data fetching) except display to the user.

One idea from @dej611 could be creating a validation pipeline that is applied to the datasource and/or visualization state before that state is used for anything but displaying the dimension configurations.

const validState = getValidState(datasourceState, datasource, visualization)

// none of the invalid dimensions will be fetched because they weren't used when building the expression
const expression = datasource.toExpression(validState);
elasticmachine commented 2 years ago

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

drewdaemon commented 1 year ago

With the right (wrong?) data view, pre-ingest integration dashboards can still look awful, even after https://github.com/elastic/kibana/pull/149262. This issue should fix this because it will prevent invalid configurations from making it to the renderer.

https://github.com/elastic/kibana/pull/149262 was basically a "let-it-fail" solution. Works okay in many scenarios, but just how many was never tracked or studied.

The following dashboard contains many visualizations using the same data view. They are all (but one) failing for lack of field data while the renderer builds the elasticsearch request (esaggs has its own set of validation checks).

Dashboard errors - Screenshot 2023-09-25 at 14-31-42 Dashboards - Elastic