Skip to content

Commit f683cab

Browse files
KevinLLFzhangshenghangAias00
authored
[bugfix] Resolve incorrect display of detailed information in Prometheus task history monitoring charts under VictoriaMetrics. (apache#3248)
Co-authored-by: Jast <[email protected]> Co-authored-by: aias00 <[email protected]>
1 parent 9c38bd5 commit f683cab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hertzbeat-warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/vm/VictoriaMetricsClusterDataStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public Map<String, List<Value>> getHistoryMetricData(Long monitorId, String app,
254254
}
255255
String timeSeriesSelector =
256256
LABEL_KEY_NAME + "=\"" + labelName + "\"" + "," + LABEL_KEY_INSTANCE + "=\"" + monitorId + "\"" + ","
257-
+ MONITOR_METRIC_KEY + "=\"" + metric + "\"";
257+
+ (CommonConstants.PROMETHEUS.equals(app) ? "" : "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"");
258258
Map<String, List<Value>> instanceValuesMap = new HashMap<>(8);
259259
try {
260260
HttpHeaders headers = new HttpHeaders();
@@ -349,7 +349,7 @@ public Map<String, List<Value>> getHistoryIntervalMetricData(Long monitorId, Str
349349
}
350350
String timeSeriesSelector =
351351
LABEL_KEY_NAME + "=\"" + labelName + "\"" + "," + LABEL_KEY_INSTANCE + "=\"" + monitorId + "\"" + ","
352-
+ MONITOR_METRIC_KEY + "=\"" + metric + "\"";
352+
+ (CommonConstants.PROMETHEUS.equals(app) ? "" : "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"");
353353
Map<String, List<Value>> instanceValuesMap = new HashMap<>(8);
354354
try {
355355
HttpHeaders headers = new HttpHeaders();

hertzbeat-warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/vm/VictoriaMetricsDataStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public Map<String, List<Value>> getHistoryMetricData(Long monitorId, String app,
253253
}
254254
String timeSeriesSelector = LABEL_KEY_NAME + "=\"" + labelName + "\""
255255
+ "," + LABEL_KEY_INSTANCE + "=\"" + monitorId + "\""
256-
+ "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"";
256+
+ (CommonConstants.PROMETHEUS.equals(app) ? "" : "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"");
257257
Map<String, List<Value>> instanceValuesMap = new HashMap<>(8);
258258
try {
259259
HttpHeaders headers = new HttpHeaders();
@@ -347,7 +347,7 @@ public Map<String, List<Value>> getHistoryIntervalMetricData(Long monitorId, Str
347347
}
348348
String timeSeriesSelector = LABEL_KEY_NAME + "=\"" + labelName + "\""
349349
+ "," + LABEL_KEY_INSTANCE + "=\"" + monitorId + "\""
350-
+ "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"";
350+
+ (CommonConstants.PROMETHEUS.equals(app) ? "" : "," + MONITOR_METRIC_KEY + "=\"" + metric + "\"");
351351
Map<String, List<Value>> instanceValuesMap = new HashMap<>(8);
352352
try {
353353
HttpHeaders headers = new HttpHeaders();

0 commit comments

Comments
 (0)