Skip to content
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

[Monitoring] Make alert status fetching more resilient #84676

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions x-pack/plugins/monitoring/public/views/base_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ export class MonitoringViewBaseController {
if (isSetupModeFeatureEnabled(SetupModeFeature.MetricbeatMigration)) {
promises.push(updateSetupModeData());
}
this.updateDataPromise = new PromiseWithCancel(Promise.all(promises));
this.updateDataPromise = new PromiseWithCancel(Promise.allSettled(promises));
return this.updateDataPromise.promise().then(([pageData, alerts]) => {
$scope.$apply(() => {
this._isDataInitialized = true; // render will replace loading screen with the react component
$scope.pageData = this.data = pageData; // update the view's data with the fetch result
$scope.alerts = this.alerts = alerts;
$scope.pageData = this.data = pageData.value; // update the view's data with the fetch result
$scope.alerts = this.alerts = alerts.value || {};
});
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,32 @@ export async function getClustersFromRequest(
'production'
);
if (prodLicenseInfo.clusterAlerts.enabled) {
cluster.alerts = {
list: await fetchStatus(
alertsClient,
req.server.plugins.monitoring.info,
undefined,
cluster.cluster_uuid,
start,
end,
[]
),
alertsMeta: {
enabled: true,
},
};
try {
cluster.alerts = {
list: await fetchStatus(
alertsClient,
req.server.plugins.monitoring.info,
undefined,
cluster.cluster_uuid,
start,
end,
[]
),
alertsMeta: {
enabled: true,
},
};
} catch (err) {
req.logger.warn(
`Unable to fetch alert status because '${err.message}'. Alerts may not properly show up in the UI.`
);
cluster.alerts = {
list: {},
alertsMeta: {
enabled: true,
},
};
}
continue;
}

Expand Down