Skip to content

Conversation

@lizozom
Copy link
Contributor

@lizozom lizozom commented Jun 13, 2022

Summary

Needed for https://github.com/elastic/kibana-team/issues/501
Depends on #134786

This PR reports a telemetry event each time a dashboard's data is loaded.
It does so by standardizing the loading, rendered and error attributes of the Embeddable interface.
It also adds a readonly property named reportsEmbeddableLoad, to default to immediate rendering, in case the Embeddable doesn't implement specific states.

Each embeddable sets it output with these attributes

  • loading - true when loading data, false otherwise
  • rendered - true when the visualization is fully rendered (similar to data-rendercomplete`)
  • error - any error that happened while loading data or rendering

Each embeddable_child_panel receives an optional callback named onPanelStatusChange. It is called every time the underlaying embeddable changes it's (relevant) output, containg:

  • status - the current event, statuses are from EmbeddableRenderStatus
  • id - the embeddable id
  • timeToEvent - time relative to the component mount
  • error - if was returned by the embeddable

The dashboard_grid then listens to the events coming in from all panels, and when all have completed, it reports a telemetry event that contains:

  • timeToData - the time it took to load the data of all embeddables (Known issue with vector tile maps @nreese)
  • timeToDone - the time it took to render all panels
  • status - ok if all loaded successfully, error otherwise.
  • numOfPanels - number of panels on that dashboard

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:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@lizozom lizozom changed the title Dashboard events Dashboard data loaded event Jun 13, 2022
@lizozom lizozom marked this pull request as ready for review June 20, 2022 14:10
@lizozom lizozom requested review from a team as code owners June 20, 2022 14:10
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Jun 20, 2022
@lizozom lizozom added release_note:skip Skip the PR/issue when compiling release notes and removed Feature:Embedding Embedding content via iFrame labels Jun 20, 2022
@lizozom lizozom requested a review from a team as a code owner June 28, 2022 14:50
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-gis changes LGTM

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the EBT FTR docs to reflect the changes to the option fromTimestamp 😇

@kibana-ci
Copy link

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #27 / maps app embeddable maps in embeddable library unlink map panel from embeddable library

Metrics [docs]

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 comments for more detailed information.

id before after diff
embeddable 403 413 +10
lens 522 523 +1
maps 247 248 +1
total +12

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 380.9KB 381.6KB +696.0B
discover 493.2KB 493.3KB +145.0B
lens 1.2MB 1.2MB +254.0B
maps 2.6MB 2.6MB +469.0B
visualizations 241.8KB 242.0KB +258.0B
total +1.8KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
total size 7.7MB 7.7MB +93.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 65.9KB 66.4KB +439.0B
embeddable 67.8KB 68.5KB +686.0B
total +1.1KB
Unknown metric groups

API count

id before after diff
embeddable 494 505 +11
lens 600 601 +1
maps 248 249 +1
total +13

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @lizozom

@lizozom lizozom merged commit 142661c into elastic:main Jul 12, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jul 12, 2022
nreese added a commit that referenced this pull request Apr 26, 2023
…55885)

Fixes #155773

#134243 surfaced layer errors as
`output.error`. This was a mistake and caused map embeddable to render
only the layer error instead of the map
<img width="500" alt="Screen Shot 2023-04-26 at 7 27 00 AM"
src="https://user-images.githubusercontent.com/373691/234602920-4d063a4b-bc02-4fac-9037-0774a790b471.png">

PR resolves issue by no longer surfacing layer errors as `output.error`.
The map legend does a great job of surfacing individual layer errors and
still keeps the map usable.
<img width="500" alt="Screen Shot 2023-04-26 at 7 26 42 AM"
src="https://user-images.githubusercontent.com/373691/234603008-8c24674f-21ca-4046-88ed-b1f7b5a06b5b.png">

To test
* install web log sample data
* Add runtime geo point field to data view
* create and save map with runtime geo point field.
* remove runtime field from data view
* add map to dashboard. Verify map is displayed and error is surfaced in
map legend

---------

Co-authored-by: Kibana Machine <[email protected]>
nreese added a commit to nreese/kibana that referenced this pull request Apr 26, 2023
…astic#155885)

Fixes elastic#155773

elastic#134243 surfaced layer errors as
`output.error`. This was a mistake and caused map embeddable to render
only the layer error instead of the map
<img width="500" alt="Screen Shot 2023-04-26 at 7 27 00 AM"
src="https://user-images.githubusercontent.com/373691/234602920-4d063a4b-bc02-4fac-9037-0774a790b471.png">

PR resolves issue by no longer surfacing layer errors as `output.error`.
The map legend does a great job of surfacing individual layer errors and
still keeps the map usable.
<img width="500" alt="Screen Shot 2023-04-26 at 7 26 42 AM"
src="https://user-images.githubusercontent.com/373691/234603008-8c24674f-21ca-4046-88ed-b1f7b5a06b5b.png">

To test
* install web log sample data
* Add runtime geo point field to data view
* create and save map with runtime geo point field.
* remove runtime field from data view
* add map to dashboard. Verify map is displayed and error is surfaced in
map legend

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 1b64cfa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes v8.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.