From f6f5d46ec271a3206bfef26bda7e15b65af41cd0 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Fri, 19 Jan 2024 08:40:10 +0800 Subject: [PATCH] bugfix prometheus type metrics threshold alarm not work (#1498) --- .../org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java index e7ae171b60e..666919c111f 100644 --- a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java +++ b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java @@ -132,6 +132,9 @@ private void calculate(CollectRep.MetricsData metricsData) { long currentTimeMilli = System.currentTimeMillis(); long monitorId = metricsData.getId(); String app = metricsData.getApp(); + if (app.startsWith(CommonConstants.PROMETHEUS_APP_PREFIX)) { + app = CommonConstants.PROMETHEUS; + } String metrics = metricsData.getMetrics(); // If the metrics whose scheduling priority is 0 has the status of collecting response data UN_REACHABLE/UN_CONNECTABLE, // the highest severity alarm is generated to monitor the status change