-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Uptime] Redirect to error page when Heartbeat mappings are missing #110857
Merged
justinkambic
merged 19 commits into
elastic:master
from
justinkambic:359/detect-mapping-failure
Sep 23, 2021
Merged
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fb6826c
Initial PoC of redirect on mapping error is working.
justinkambic 96b8de9
Update copy. Add comments.
justinkambic 630618a
Include headline element for page title.
justinkambic 64ed589
Create mappings for failing functional tests.
justinkambic f6a4159
Add functional test for mappings error page.
justinkambic 1cb42f8
Add mapping for certs check.
justinkambic 160b0e8
Add docs link.
justinkambic d259608
Add missing word to copy.
justinkambic aa4e63e
Merge branch 'master' into 359/detect-mapping-failure
kibanamachine 93bfe76
Merge branch 'master' into 359/detect-mapping-failure
kibanamachine dab934e
Merge branch 'master' into 359/detect-mapping-failure
kibanamachine a43034c
Merge master.
justinkambic 50d82af
Add conditional redirect hook for monitor list.
justinkambic 3783242
Merge branch '359/detect-mapping-failure' of github.com:justinkambic/…
justinkambic 8b96641
Delete obsolete files from bad merge.
justinkambic 03e9ae1
Remove useless comment.
justinkambic be3ad06
Fix broken code style due to prettier update.
justinkambic c011e76
Fix import name.
justinkambic 3045223
Merge branch 'master' into 359/detect-mapping-failure
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* 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 { EuiCode, EuiEmptyPrompt, EuiLink, EuiTitle } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
import React from 'react'; | ||
|
||
import { useKibana } from '../../../../../src/plugins/kibana_react/public'; | ||
import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; | ||
import { useTrackPageview } from '../../../observability/public'; | ||
|
||
export const MappingErrorPage = () => { | ||
useTrackPageview({ app: 'uptime', path: 'mapping-error' }); | ||
useTrackPageview({ app: 'uptime', path: 'mapping-error', delay: 15000 }); | ||
|
||
const docLinks = useKibana().services.docLinks; | ||
|
||
useBreadcrumbs([ | ||
{ | ||
text: i18n.translate('xpack.uptime.mappingErrorRoute.breadcrumb', { | ||
defaultMessage: 'Mapping error', | ||
}), | ||
}, | ||
]); | ||
|
||
return ( | ||
<EuiEmptyPrompt | ||
data-test-subj="xpack.uptime.mappingsErrorPage" | ||
iconColor="danger" | ||
iconType="cross" | ||
title={ | ||
<EuiTitle> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.uptime.public.pages.mappingError.title" | ||
defaultMessage="Heartbeat mappings missing" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
} | ||
body={ | ||
<div> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.uptime.public.pages.mappingError.bodyMessage" | ||
defaultMessage="Incorrect mappings detected! Perhaps you forgot to run the heartbeat {setup} command?" | ||
values={{ setup: <EuiCode>setup</EuiCode> }} | ||
/> | ||
</p> | ||
{docLinks && ( | ||
<p> | ||
<FormattedMessage | ||
id="xpack.uptime.public.pages.mappingError.bodyDocsLink" | ||
defaultMessage="You can learn how to troubleshoot this issue in the {docsLink}." | ||
values={{ | ||
docsLink: ( | ||
<EuiLink | ||
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/troubleshoot-uptime-mapping-issues.html`} | ||
target="_blank" | ||
> | ||
docs | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</p> | ||
)} | ||
</div> | ||
} | ||
/> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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 { FtrProviderContext } from '../../ftr_provider_context'; | ||
import { makeCheck } from '../../../api_integration/apis/uptime/rest/helper/make_checks'; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const { common } = getPageObjects(['common']); | ||
const uptimeService = getService('uptime'); | ||
|
||
const es = getService('es'); | ||
describe('missing mappings', function () { | ||
before(async () => { | ||
await makeCheck({ es }); | ||
await common.navigateToApp('uptime'); | ||
}); | ||
|
||
it('redirects to mappings error page', async () => { | ||
await uptimeService.common.hasMappingsError(); | ||
}); | ||
}); | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 route has been , infact this whole API has been removed in our filters API, so i wonder if this is the correct appraoch to handle this kind of error.
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.
Yes I overlooked that - a dedicated route may be the way to go. The inclination for this approach is, we don't want to slow down the happy path that 99% of users will experience for the sake of this one other case. While it's a common error, it's rare for people to experience it.
Perhaps we should depend on the filters PR and adjust the logic in this PR to fit the error in that one, since the error should still occur with the new fetch procedure.