-
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.
Browse files
Browse the repository at this point in the history
* [Monitoring][Alerting] CCR read exceptions alert (#85908) * CCR read exceptions all branches * cleanup * CR feedback * Added UI/UX to ccr/shards listing and details * Fixed snaps * Added reason for the exception * Added setup mode funtionality and alert status # Conflicts: # x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js * Update ccr.js * Update ccr.test.js.snap
- Loading branch information
Showing
24 changed files
with
835 additions
and
134 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
49 changes: 49 additions & 0 deletions
49
x-pack/plugins/monitoring/public/alerts/ccr_read_exceptions_alert/index.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,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { Expression, Props } from '../components/duration/expression'; | ||
import { AlertTypeModel, ValidationResult } from '../../../../triggers_actions_ui/public'; | ||
import { ALERT_CCR_READ_EXCEPTIONS, ALERT_DETAILS } from '../../../common/constants'; | ||
|
||
interface ValidateOptions { | ||
duration: string; | ||
} | ||
|
||
const validate = (inputValues: ValidateOptions): ValidationResult => { | ||
const validationResult = { errors: {} }; | ||
const errors: { [key: string]: string[] } = { | ||
duration: [], | ||
}; | ||
if (!inputValues.duration) { | ||
errors.duration.push( | ||
i18n.translate('xpack.monitoring.alerts.validation.duration', { | ||
defaultMessage: 'A valid duration is required.', | ||
}) | ||
); | ||
} | ||
validationResult.errors = errors; | ||
return validationResult; | ||
}; | ||
|
||
export function createCCRReadExceptionsAlertType(): AlertTypeModel { | ||
return { | ||
id: ALERT_CCR_READ_EXCEPTIONS, | ||
name: ALERT_DETAILS[ALERT_CCR_READ_EXCEPTIONS].label, | ||
description: ALERT_DETAILS[ALERT_CCR_READ_EXCEPTIONS].description, | ||
iconClass: 'bell', | ||
documentationUrl(docLinks) { | ||
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/kibana-alerts.html`; | ||
}, | ||
alertParamsExpression: (props: Props) => ( | ||
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_CCR_READ_EXCEPTIONS].paramDetails} /> | ||
), | ||
validate, | ||
defaultActionMessage: '{{context.internalFullMessage}}', | ||
requiresAppContext: true, | ||
}; | ||
} |
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
15 changes: 15 additions & 0 deletions
15
x-pack/plugins/monitoring/public/components/elasticsearch/ccr/__snapshots__/ccr.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.