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

[Dashboard] Index Pattern Observable Error Handling #106155

Merged

Conversation

ThomThomson
Copy link
Contributor

Summary

Fixes #105963

Adds basic error handling to the dashboard index pattern sync observable. When an error is pushed to the output of any embeddable in the container, a catchError operator catches and swallows the error. This allows error embeddables to properly catch and show their own errors, while always showing the correct index pattern(s) on the dashboard, with any mix of error & non-error embeddable panels.

This PR also adds a new dashboard error case JSON file for use withkbn_archiver, as well as a usage example. Eventually the rest of the es_archiver data used for the dashboard functional tests will need to be migrated over.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@ThomThomson ThomThomson added Feature:Dashboard Dashboard related features release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:medium Medium Level of Effort v8.0.0 impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. v7.14.0 labels Jul 19, 2021
@ThomThomson
Copy link
Contributor Author

@elasticmachine merge upstream

@ThomThomson ThomThomson marked this pull request as ready for review July 20, 2021 15:32
@ThomThomson ThomThomson requested a review from a team as a code owner July 20, 2021 15:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

fix LGTM

)
),
// Embeddables often throw errors into their output streams.
catchError(() => EMPTY)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd move this to a specific child's observable instead:

switchMap((newChildIds: string[]) =>
         merge(...newChildIds.map((childId) => dashboardContainer!.getChild(childId).getOutput$().pipe(catchError(() => EMPTY))))
       ),

I don't think there is a functional difference in how the whole pipe works, but semantically I think this would make more sense as we want to mute errors from a specific output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does make a lot more sense, I have moved the catchError into the embeddable output streams instead. Thanks!

Copy link
Contributor

@poffdeluxe poffdeluxe left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
dashboard 221.4KB 221.5KB +103.0B

History

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

@ThomThomson ThomThomson merged commit 5411652 into elastic:master Jul 21, 2021
ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Jul 21, 2021
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Jul 21, 2021
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
ThomThomson added a commit that referenced this pull request Jul 21, 2021
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
ThomThomson added a commit that referenced this pull request Jul 21, 2021
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.14.0 v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Visualization error when dashboard is accessed via recently viewed
5 participants