diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java index 599fc9ee2a1..4afeb956a16 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java @@ -221,6 +221,8 @@ public Map> getHistoryMetricData(Long monitorId, String app, HttpEntity httpEntity = new HttpEntity<>(headers); URI uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + EXPORT_PATH) .queryParam(URLEncoder.encode("match[]", StandardCharsets.UTF_8), URLEncoder.encode("{" + timeSeriesSelector + "}", StandardCharsets.UTF_8)) + .queryParam("start", URLEncoder.encode("now-" + history, StandardCharsets.UTF_8)) + .queryParam("end", "now") .build(true).toUri(); ResponseEntity responseEntity = restTemplate.exchange(uri, HttpMethod.GET, httpEntity, String.class);