-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infrastructure UI] Improve error handling metric index (#152840)
## 📓 Summary Closes #144882 This PR updates the error handling in case the user configure a remote index that was returning an error, giving more meaningful feedback to the user. It also includes a refactor for the `useSource` custom hook and removes the usages for the legacy `useSourceViaHttp` custom hook. ## 🧪 Testing - Navigate to the metrics setting page - Set a wrongly formatted or non-existing remote cluster - Verify to get a toast notification about the issue and to get notified about the same issue when accessing inventory and hosts pages. **Before** <img width="1741" alt="before" src="https://user-images.githubusercontent.com/34506779/223672635-abb3a7f3-e8a6-43b6-972c-813514d1b63a.png"> **After** https://user-images.githubusercontent.com/34506779/223672676-017422fb-ccc7-456e-854c-ec79837da281.mp4 ## 👣 Next step As happens in the Data View stack management section, would be nice to inform the user while he types the index pattern if no associated data view matches the typed wildcard. An additional value could be, in case the user wants to anyway set the index pattern, to inform him with a callout message that it doesn't match any data view, so that the issue cause is immediately clear when no data are viewed on the metrics pages. - [ ] #152885 --------- Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
- Loading branch information
1 parent
293dd26
commit ca8848e
Showing
37 changed files
with
530 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
x-pack/plugins/infra/public/components/empty_states/no_remote_cluster.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiButton } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { useLinkProps } from '@kbn/observability-plugin/public'; | ||
import { NoIndices } from './no_indices'; | ||
|
||
export const NoRemoteCluster = () => { | ||
const settingLinkProps = useLinkProps({ app: 'metrics', pathname: '/settings' }); | ||
|
||
const goToSettings = ( | ||
<EuiButton data-test-subj="infraHostsPageGoToSettings" color="danger" {...settingLinkProps}> | ||
{i18n.translate('xpack.infra.hostsPage.goToMetricsSettings', { | ||
defaultMessage: 'Check settings', | ||
})} | ||
</EuiButton> | ||
); | ||
|
||
return ( | ||
<NoIndices | ||
color="danger" | ||
iconType="error" | ||
titleSize="m" | ||
title={i18n.translate('xpack.infra.sourceConfiguration.noRemoteClusterTitle', { | ||
defaultMessage: "Couldn't connect to the remote cluster", | ||
})} | ||
body={i18n.translate('xpack.infra.sourceConfiguration.noRemoteClusterMessage', { | ||
defaultMessage: | ||
"We're unable to connect to the remote cluster, which is preventing us from retrieving the metrics and data you need.\nTo resolve this issue, please check your indices configuration and ensure that it's properly configured.", | ||
})} | ||
actions={[goToSettings]} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.