You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/09/02 17:26:40 UTC

[GitHub] [incubator-pinot] jihaozh opened a new pull request #5962: [TE] Severity based alerter

jihaozh opened a new pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962


   ## Description
   This PR adds the severity based alerting. It sends out anomalies to different email/Jira channels based on its anomaly severity. It also supports re-sending the alert if a given anomaly's severity has changed. This is achieved by adding a new lookup table for recording the relationship between an anomaly and subscription groups.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] vincentchenjl commented on a change in pull request #5962: [TE] Severity based alerter

Posted by GitBox <gi...@apache.org>.
vincentchenjl commented on a change in pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962#discussion_r483806658



##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionResource.java
##########
@@ -570,4 +574,19 @@ public Response getDetectionHealth(@PathParam("id") @ApiParam("detection config
     }
     return Response.ok(health).build();
   }
+
+  @POST
+  @Path(value = "/re-notify")
+  @ApiOperation("Resend the notification for the anomalies to the subscribed notification groups, if the subscription group supports re-notify")
+  public Response alert(@QueryParam("id") List<Long> anomalyIds) {
+    List<MergedAnomalyResultDTO> anomalies = this.anomalyDAO.findByIds(anomalyIds);
+    for (MergedAnomalyResultDTO anomaly : anomalies) {
+      AnomalySubscriptionGroupNotificationDTO anomalySubscriptionGroupNotificationDTO =
+          new AnomalySubscriptionGroupNotificationDTO();
+      anomalySubscriptionGroupNotificationDTO.setAnomalyId(anomaly.getId());
+      anomalySubscriptionGroupNotificationDTO.setDetectionConfigId(anomaly.getDetectionConfigId());
+      anomalySubscriptionGroupNotificationManager.save(anomalySubscriptionGroupNotificationDTO);

Review comment:
       Why are we not checking if the corresponding entry exists for the anomalies?

##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineTaskRunner.java
##########
@@ -167,6 +175,14 @@ public DetectionPipelineTaskRunner(DetectionConfigManager detectionDAO, MergedAn
       }
       this.detectionDAO.update(config);
 
+      // re-notify the anomalies if any
+      for (MergedAnomalyResultDTO anomaly : result.getAnomalies()) {
+        // if an anomaly should be re-notified, update the notification lookup table in the database
+        if (anomaly.shouldRenotify()) {

Review comment:
       Do we expect that new anomalies also have `renotify` flag as true? Or this should only apply for existing anomalies?

##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/constant/AnomalySeverity.java
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.pinot.thirdeye.constant;
+
+public enum AnomalySeverity {
+  LOW("low"), MODERATE("moderate"), HIGH("high"), CRITICAL("critical"), DEFAULT("default");

Review comment:
       There's a conflict here between this PR and mine. The labeler in the other PR relies on the order of the severity. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] jihaozh commented on a change in pull request #5962: [TE] Severity based alerter

Posted by GitBox <gi...@apache.org>.
jihaozh commented on a change in pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962#discussion_r485111503



##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionResource.java
##########
@@ -570,4 +574,19 @@ public Response getDetectionHealth(@PathParam("id") @ApiParam("detection config
     }
     return Response.ok(health).build();
   }
+
+  @POST
+  @Path(value = "/re-notify")
+  @ApiOperation("Resend the notification for the anomalies to the subscribed notification groups, if the subscription group supports re-notify")
+  public Response alert(@QueryParam("id") List<Long> anomalyIds) {
+    List<MergedAnomalyResultDTO> anomalies = this.anomalyDAO.findByIds(anomalyIds);
+    for (MergedAnomalyResultDTO anomaly : anomalies) {
+      AnomalySubscriptionGroupNotificationDTO anomalySubscriptionGroupNotificationDTO =
+          new AnomalySubscriptionGroupNotificationDTO();
+      anomalySubscriptionGroupNotificationDTO.setAnomalyId(anomaly.getId());
+      anomalySubscriptionGroupNotificationDTO.setDetectionConfigId(anomaly.getDetectionConfigId());
+      anomalySubscriptionGroupNotificationManager.save(anomalySubscriptionGroupNotificationDTO);

Review comment:
       good catch. updated!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] akshayrai commented on a change in pull request #5962: [TE] Severity based alerter

Posted by GitBox <gi...@apache.org>.
akshayrai commented on a change in pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962#discussion_r485229689



##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datalayer/bao/AnomalySubscriptionGroupNotificationManager.java
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.pinot.thirdeye.datalayer.bao;
+
+import org.apache.pinot.thirdeye.datalayer.dto.AnomalySubscriptionGroupNotificationDTO;
+
+
+public interface AnomalySubscriptionGroupNotificationManager

Review comment:
       pls include some javadocs

##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/constant/AnomalySeverity.java
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.pinot.thirdeye.constant;
+
+public enum AnomalySeverity {

Review comment:
       javadocs




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] jihaozh merged pull request #5962: [TE] Severity based alerter

Posted by GitBox <gi...@apache.org>.
jihaozh merged pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] jihaozh commented on a change in pull request #5962: [TE] Severity based alerter

Posted by GitBox <gi...@apache.org>.
jihaozh commented on a change in pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962#discussion_r485111715



##########
File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineTaskRunner.java
##########
@@ -167,6 +175,14 @@ public DetectionPipelineTaskRunner(DetectionConfigManager detectionDAO, MergedAn
       }
       this.detectionDAO.update(config);
 
+      // re-notify the anomalies if any
+      for (MergedAnomalyResultDTO anomaly : result.getAnomalies()) {
+        // if an anomaly should be re-notified, update the notification lookup table in the database
+        if (anomaly.shouldRenotify()) {

Review comment:
       no. the renotify flag only applies to exist anomalies.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org