From 3b23991e3c89a1975703e0488638ea2627b936ae Mon Sep 17 00:00:00 2001 From: Daniel Isen Date: Mon, 23 Nov 2020 12:24:57 -0800 Subject: [PATCH] [Platform] Fix regression with backup failure email #6461 Summary: When implementing replication lag alerting, I caused a regression with backup failure alerting. Need to fix field names in the alert payload. @cnarang noticed that emails weren't being sent when testing this feature on 2.5.1. Tested the feature on his installation of the platform and saw ``` Invalid alert_info_json ``` being logged for cluster_health.py when running it manually with the logged payload from the platform. This should resolve the issue. Test Plan: Test backup failure alert Reviewers: arnav, wesley, sanketh Reviewed By: sanketh Subscribers: cnarang, jenkins-bot, yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D9972 --- .../java/com/yugabyte/yw/commissioner/AbstractTaskBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/managed/src/main/java/com/yugabyte/yw/commissioner/AbstractTaskBase.java b/managed/src/main/java/com/yugabyte/yw/commissioner/AbstractTaskBase.java index 85d6f4f79205..df205439d64b 100644 --- a/managed/src/main/java/com/yugabyte/yw/commissioner/AbstractTaskBase.java +++ b/managed/src/main/java/com/yugabyte/yw/commissioner/AbstractTaskBase.java @@ -174,11 +174,11 @@ public void sendNotification() { CustomerTask task = CustomerTask.findByTaskUUID(userTaskUUID); Customer customer = Customer.get(task.getCustomerUUID()); ObjectNode notificationData = Json.newObject() - .put("alertname", "Backup failure") + .put("alert_name", "Backup failure") .put("task_type", task.getType().name()) .put("target_type", task.getTarget().name()) .put("target_name", task.getNotificationTargetName()) - .put("alert_info", taskInfo); + .put("task_info", taskInfo); String customerTag = String.format("[%s][%s]", customer.name, customer.code); List destinations = new ArrayList<>(); String ybEmail = appConfig.getString("yb.health.default_email", null);