kibana
kibana copied to clipboard
[TSVB][Lens] Add "open in lens" functionality for Top N
Summary
As part of phasing out TSVB and Visualize all TSVB visulizations should support "open in lens" functionality. In that PR converter for Top N was added.
Top N in TSVB:

In Lens:

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)
@elasticmachine merge upstream
@elasticmachine merge upstream
Hey! Thanx for working on this. Some comments and questions from my side:
I wonder why don't we allow the transition for multiple layers? For example:

can be translated to

As long this is not allowed in TSVB, we should not allow the transition to Lens either

The last value mode should be converted to Lens with the Reduced time range setting. Am I right @flash1293 ?

There are some aggs that work on TSVB such as the cumulative sum (due to the date_histogram) but not in Lens. Should we allow this transition? cc @flash1293

In case of percentile ranks split by terms the custom color is not transferred in Lens. So for example this will transition to Lens with the default green color.

I wonder why don't we allow the transition for multiple layers
Vlad and me discussed this - as the chart looks pretty weird due to the empty slots for the other series, we decided to not convert these for now. However, looking at it again I think it's worth doing the conversion even if it looks a little weird - better than no chart. @VladLasitsa could you change this? Sorry for the back and forth
The last value mode should be converted to Lens with the Reduced time range setting. Am I right
yes exactly! I didn't mention this in the doc. We can also split it out. I'll update the doc
There are some aggs that work on TSVB such as the cumulative sum (due to the date_histogram) but not in Lens. Should we allow this transition?
No, let's block these please.
Thanx Joe! I had updated the doc some days ago if I recall correctly!
@elasticmachine merge upstream
@stratoula, Could you please review again?
Thanx Vlad! Found one bug!
If I am on TopN last value and then go back to timeseries and click "Navigate to Lens" I see this error

This happens because we also transfer the last value mode which is wrong as the timeseries chart is not compatible with this.
@elasticmachine merge upstream
Thanx Vlad! Found one bug! If I am on TopN last value and then go back to timeseries and click "Navigate to Lens" I see this error
This happens because we also transfer the last value mode which is wrong as the timeseries chart is not compatible with this.
Fixed
Looks pretty good, just found one bug: "Last value" mode is not respected for formula-type dimensions (like standard deviation or filter ratio) - it seems like it's just ignored for these cases.
Looks pretty good, just found one bug: "Last value" mode is not respected for formula-type dimensions (like standard deviation or filter ratio) - it seems like it's just ignored for these cases.
@flash1293, Could you please re-test?
Seems like filter ratio is not convertable anymore:

Maybe the check for "missing field" went wrong?
It also still tries to set the reduced time range when on a timeseries chart:

As discussed in the weekly sync, parent pipeline aggregations should not be convertable for charts other than time series because they are executed along the time axis and there isn't a time axis in Lens:

This conversion is not equivalent, the overall_sum is doing something else in Lens than in TSVB
@elasticmachine merge upstream
:green_heart: Build Succeeded
- Buildkite Build
- Commit: 4e31a2946c086e3d2757366c3d8da5795b385689
Metrics [docs]
Module Count
Fewer modules leads to a faster build time
| id | before | after | diff |
|---|---|---|---|
visTypeTimeseries |
361 | 363 | +2 |
Public APIs missing comments
Total count of every public API that lacks a comment. Target amount is 0. Run
node scripts/build_api_docs --plugin [yourplugin] --stats commentsfor more detailed information.
| id | before | after | diff |
|---|---|---|---|
data |
2428 | 2431 | +3 |
visualizations |
386 | 388 | +2 |
| total | +5 |
Async chunks
Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app
| id | before | after | diff |
|---|---|---|---|
lens |
1.2MB | 1.2MB | +182.0B |
visTypeTimeseries |
453.0KB | 459.8KB | +6.8KB |
visualizations |
197.4KB | 197.4KB | +88.0B |
| total | +7.1KB |
Page load bundle
Size of the bundles that are downloaded on every page load. Target size is below 100kb
| id | before | after | diff |
|---|---|---|---|
data |
429.5KB | 429.6KB | +52.0B |
visTypeTimeseries |
18.7KB | 18.9KB | +178.0B |
| total | +230.0B |
Unknown metric groups
API count
| id | before | after | diff |
|---|---|---|---|
data |
3114 | 3117 | +3 |
visualizations |
414 | 416 | +2 |
| total | +5 |
async chunk count
| id | before | after | diff |
|---|---|---|---|
visTypeTimeseries |
11 | 13 | +2 |
History
- :green_heart: Build #65986 succeeded a328328aae402a050c6b532caaafabda4f22f7fb
- :green_heart: Build #65961 succeeded 4c97ac3398dd2f9723460bcee520f21fdce7d1a1
- :green_heart: Build #65292 succeeded d32db796638cc1cf5330aa2c06e4f3422c51e923
- :green_heart: Build #64791 succeeded 059c42e058f4db2e454a708558dc23fea33bfc74
- :green_heart: Build #64148 succeeded 87559dfa14b32be77ff0aeb71e319bc80539a70e
- :green_heart: Build #63843 succeeded f05039fd00c6d5f952bde4a46f8f25014756a230
To update your PR or re-run it, just comment with:
@elasticmachine merge upstream
cc @VladLasitsa