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
[Dashboard] Index Pattern Observable Error Handling #106155
Conversation
…ssues when embeddables do not load
@elasticmachine merge upstream |
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
fix LGTM
) | ||
), | ||
// Embeddables often throw errors into their output streams. | ||
catchError(() => EMPTY) |
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.
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
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 does make a lot more sense, I have moved the catchError into the embeddable output streams instead. Thanks!
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.
LGTM
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
* add error handling to dashboard index pattern observable to prevent issues when embeddables do not load
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 with
kbn_archiver
, as well as a usage example. Eventually the rest of thees_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