diff --git a/x-pack/plugins/monitoring/common/types/alerts.ts b/x-pack/plugins/monitoring/common/types/alerts.ts index 597a70bdb8c6e..5f73df4c3a1cf 100644 --- a/x-pack/plugins/monitoring/common/types/alerts.ts +++ b/x-pack/plugins/monitoring/common/types/alerts.ts @@ -111,7 +111,9 @@ export interface AlertThreadPoolRejectionsState extends AlertNodeState { } export interface AlertLicenseState extends AlertState { - expiryDateMS: number; + meta: { + expiryDateMS: number; + }; } export interface AlertNodesChangedState extends AlertState { diff --git a/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts b/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts index 6f395c62e42a2..6be4aa3edc1a8 100644 --- a/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts @@ -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.', });