mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [[Monitoring] Read expiryDateMS from the right path in License rule (#148129)](https://github.com/elastic/kibana/pull/148129) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Milton Hultgren","email":"milton.hultgren@elastic.co"},"sourceCommit":{"committedDate":"2022-12-29T17:28:13Z","message":"[Monitoring] Read expiryDateMS from the right path in License rule (#148129)\n\nThe license details have been placed under the `meta` property but the\r\ncontext messages were not updated to read correctly from that path, this\r\nPR fixes that little issue.","sha":"0b83a2a61a1a560bc8394574d50db4e9ced00731","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Infra Monitoring UI","release_note:skip","Feature:Stack Monitoring","backport:all-open","v8.7.0"],"number":148129,"url":"https://github.com/elastic/kibana/pull/148129","mergeCommit":{"message":"[Monitoring] Read expiryDateMS from the right path in License rule (#148129)\n\nThe license details have been placed under the `meta` property but the\r\ncontext messages were not updated to read correctly from that path, this\r\nPR fixes that little issue.","sha":"0b83a2a61a1a560bc8394574d50db4e9ced00731"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/148129","number":148129,"mergeCommit":{"message":"[Monitoring] Read expiryDateMS from the right path in License rule (#148129)\n\nThe license details have been placed under the `meta` property but the\r\ncontext messages were not updated to read correctly from that path, this\r\nPR fixes that little issue.","sha":"0b83a2a61a1a560bc8394574d50db4e9ced00731"}}]}] BACKPORT--> Co-authored-by: Milton Hultgren <milton.hultgren@elastic.co>
This commit is contained in:
parent
a02f42b9ac
commit
d3a625ef4a
2 changed files with 4 additions and 2 deletions
|
@ -111,7 +111,9 @@ export interface AlertThreadPoolRejectionsState extends AlertNodeState {
|
|||
}
|
||||
|
||||
export interface AlertLicenseState extends AlertState {
|
||||
expiryDateMS: number;
|
||||
meta: {
|
||||
expiryDateMS: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AlertNodesChangedState extends AlertState {
|
||||
|
|
|
@ -155,7 +155,7 @@ export class LicenseExpirationRule extends BaseRule {
|
|||
// Logic in the base alert assumes that all alerts will operate against multiple nodes/instances (such as a CPU alert against ES nodes)
|
||||
// However, some alerts operate on the state of the cluster itself and are only concerned with a single state
|
||||
const state: AlertLicenseState = alertStates[0] as AlertLicenseState;
|
||||
const $duration = moment.duration(+new Date() - state.expiryDateMS);
|
||||
const $duration = moment.duration(+new Date() - state.meta.expiryDateMS);
|
||||
const actionText = i18n.translate('xpack.monitoring.alerts.licenseExpiration.action', {
|
||||
defaultMessage: 'Please update your license.',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue