alertDefines) {
- COMMON_CACHE.put(CommonConstants.METRICS_CACHE_ALERT_DEFINE, alertDefines);
+ COMMON_CACHE.put(CommonConstants.METRIC_CACHE_ALERT_DEFINE, alertDefines);
}
/**
* clear metrics alert define cache
*/
public static void clearMetricsAlertDefineCache() {
- COMMON_CACHE.remove(CommonConstants.METRICS_CACHE_ALERT_DEFINE);
+ COMMON_CACHE.remove(CommonConstants.METRIC_CACHE_ALERT_DEFINE);
}
/**
diff --git a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
index 314bced8328..b5b66939c8b 100644
--- a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
+++ b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
@@ -148,14 +148,14 @@ public interface CommonConstants {
String ALERT_STATUS_PENDING = "pending";
/**
- * metrics alert threshold type: realtime
+ * metric alert threshold type: realtime
*/
- String METRICS_ALERT_THRESHOLD_TYPE_REALTIME = "realtime_metrics";
+ String METRIC_ALERT_THRESHOLD_TYPE_REALTIME = "realtime_metric";
/**
- * metrics alert threshold type: periodic
+ * metric alert threshold type: periodic
*/
- String METRICS_ALERT_THRESHOLD_TYPE_PERIODIC = "periodic_metrics";
+ String METRIC_ALERT_THRESHOLD_TYPE_PERIODIC = "periodic_metric";
/**
* log alert threshold type: realtime
@@ -238,9 +238,9 @@ public interface CommonConstants {
String CACHE_ALERT_SILENCE = "alert_silence";
/**
- * cache key metrics alert define
+ * cache key metric alert define
*/
- String METRICS_CACHE_ALERT_DEFINE = "metrics_alert_define";
+ String METRIC_CACHE_ALERT_DEFINE = "metric_alert_define";
/**
* cache key log alert define
diff --git a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
index b5a3b013445..2434df7f017 100644
--- a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
+++ b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
@@ -65,7 +65,7 @@ public class AlertDefine {
@NotNull
private String name;
- @Schema(title = "Rule Type: realtime_metrics, periodic_metrics, realtime_log, periodic_log", example = "realtime_metrics")
+ @Schema(title = "Rule Type: realtime_metric, periodic_metric, realtime_log, periodic_log", example = "realtime_metric")
private String type;
@Schema(title = "Alarm Threshold Expr", example = "usage>90", accessMode = READ_WRITE)
diff --git a/hertzbeat-log/src/main/java/org/apache/hertzbeat/log/service/impl/OtlpLogProtocolAdapter.java b/hertzbeat-log/src/main/java/org/apache/hertzbeat/log/service/impl/OtlpLogProtocolAdapter.java
index e3593960cdc..98488085b4a 100644
--- a/hertzbeat-log/src/main/java/org/apache/hertzbeat/log/service/impl/OtlpLogProtocolAdapter.java
+++ b/hertzbeat-log/src/main/java/org/apache/hertzbeat/log/service/impl/OtlpLogProtocolAdapter.java
@@ -70,7 +70,7 @@ public void ingest(String content) {
logEntries.forEach(entry -> {
try {
commonDataQueue.sendLogEntry(entry);
- log.debug("Log entry sent to queue: {}", entry);
+ log.info("Log entry sent to queue: {}", entry);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("Failed to send log entry to queue: {}", e.getMessage());
diff --git a/hertzbeat-manager/src/main/resources/db/migration/h2/V173__update_column.sql b/hertzbeat-manager/src/main/resources/db/migration/h2/V173__update_column.sql
index 1615a5a9bb4..42490384122 100644
--- a/hertzbeat-manager/src/main/resources/db/migration/h2/V173__update_column.sql
+++ b/hertzbeat-manager/src/main/resources/db/migration/h2/V173__update_column.sql
@@ -19,12 +19,12 @@
-- Update hzb_alert_define table type column to support log monitoring
--- Update type from 'realtime' to 'realtime_metrics'
+-- Update type from 'realtime' to 'realtime_metric'
UPDATE HZB_ALERT_DEFINE
-SET type = 'realtime_metrics'
+SET type = 'realtime_metric'
WHERE type = 'realtime';
--- Update type from 'periodic' to 'periodic_metrics'
+-- Update type from 'periodic' to 'periodic_metric'
UPDATE HZB_ALERT_DEFINE
-SET type = 'periodic_metrics'
+SET type = 'periodic_metric'
WHERE type = 'periodic';
diff --git a/hertzbeat-manager/src/main/resources/db/migration/mysql/V173__update_column.sql b/hertzbeat-manager/src/main/resources/db/migration/mysql/V173__update_column.sql
index 678332850e1..d312038e3c5 100644
--- a/hertzbeat-manager/src/main/resources/db/migration/mysql/V173__update_column.sql
+++ b/hertzbeat-manager/src/main/resources/db/migration/mysql/V173__update_column.sql
@@ -30,14 +30,14 @@ BEGIN
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'HZB_ALERT_DEFINE';
IF table_exists = 1 THEN
- -- Update type from 'realtime' to 'realtime_metrics'
+ -- Update type from 'realtime' to 'realtime_metric'
UPDATE HZB_ALERT_DEFINE
- SET type = 'realtime_metrics'
+ SET type = 'realtime_metric'
WHERE type = 'realtime';
- -- Update type from 'periodic' to 'periodic_metrics'
+ -- Update type from 'periodic' to 'periodic_metric'
UPDATE HZB_ALERT_DEFINE
- SET type = 'periodic_metrics'
+ SET type = 'periodic_metric'
WHERE type = 'periodic';
END IF;
END //
diff --git a/hertzbeat-manager/src/main/resources/db/migration/postgresql/V173__update_column.sql b/hertzbeat-manager/src/main/resources/db/migration/postgresql/V173__update_column.sql
index e2822d58597..1e5d005b969 100644
--- a/hertzbeat-manager/src/main/resources/db/migration/postgresql/V173__update_column.sql
+++ b/hertzbeat-manager/src/main/resources/db/migration/postgresql/V173__update_column.sql
@@ -19,14 +19,14 @@
-- Update hzb_alert_define table type column to support log monitoring
--- Update type from 'realtime' to 'realtime_metrics'
+-- Update type from 'realtime' to 'realtime_metric'
UPDATE HZB_ALERT_DEFINE
-SET type = 'realtime_metrics'
+SET type = 'realtime_metric'
WHERE type = 'realtime';
--- Update type from 'periodic' to 'periodic_metrics'
+-- Update type from 'periodic' to 'periodic_metric'
UPDATE HZB_ALERT_DEFINE
-SET type = 'periodic_metrics'
+SET type = 'periodic_metric'
WHERE type = 'periodic';
commit;
diff --git a/web-app/src/app/pojo/AlertDefine.ts b/web-app/src/app/pojo/AlertDefine.ts
index 4d18174bda5..364666a7f9d 100644
--- a/web-app/src/app/pojo/AlertDefine.ts
+++ b/web-app/src/app/pojo/AlertDefine.ts
@@ -20,8 +20,8 @@
export class AlertDefine {
id!: number;
name!: string;
- // realtime_metrics, periodic_metrics, realtime_log, periodic_log
- type: string = 'realtime_metrics';
+ // realtime_metric, periodic_metric, realtime_log, periodic_log
+ type: string = 'realtime_metric';
// datasource when type is periodic, promql | sql
datasource: string = 'promql';
expr!: string;
diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
index 267b5931f9a..6a5a7fe5ed3 100644
--- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
+++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
@@ -113,17 +113,17 @@
{{ data.name }}
-
- {{ 'alert.setting.type.metrics.realtime' | i18n }}
+
+ {{ 'alert.setting.type.realtime.metric' | i18n }}
-
- {{ 'alert.setting.type.metrics.periodic' | i18n }}
+
+ {{ 'alert.setting.type.periodic.metric' | i18n }}
- {{ 'alert.setting.type.log.realtime' | i18n }}
+ {{ 'alert.setting.type.realtime.log' | i18n }}
- {{ 'alert.setting.type.log.periodic' | i18n }}
+ {{ 'alert.setting.type.periodic.log' | i18n }}
|
@@ -180,7 +180,7 @@
-
+
+
+
+ {{ 'alert.setting.datatype' | i18n }}
+
+
+
+
+
+
+
+
+
{{ 'alert.setting.target' | i18n }}
@@ -214,7 +239,7 @@
>
- 0" [ngStyle]="{ marginBottom: '5px' }">
+ 0" [ngStyle]="{ marginBottom: '5px' }">
{{ 'alert.setting.rule' | i18n }}
@@ -245,7 +270,7 @@
- 0 && cascadeValues[1] !== 'availability' && isExpr">
+ 0 && cascadeValues[1] !== 'availability' && isExpr">
@@ -287,7 +312,7 @@
- 0 && cascadeValues[1] !== 'availability' && !isExpr">
+ 0 && cascadeValues[1] !== 'availability' && !isExpr">
@@ -396,7 +421,7 @@
-
+
{{ 'alert.setting.bind.monitors' | i18n }}
@@ -407,7 +432,7 @@
-
+
{{ 'alert.setting.preview.expr' | i18n }}
@@ -417,6 +442,7 @@
+
{{ 'alert.setting.rule' | i18n }}
@@ -439,6 +465,7 @@
+
@@ -487,6 +514,7 @@
+
@@ -615,6 +643,7 @@
+
{{ 'alert.setting.preview.expr' | i18n }}
@@ -625,7 +654,7 @@
-
+
{{ 'alert.setting.rule' | i18n }}
@@ -639,7 +668,7 @@
-
+
@@ -685,7 +714,7 @@
-
+
{{ 'alert.setting.period' | i18n }}
@@ -737,9 +766,8 @@
|