From f0dad8bfb1e00bfa25197b152ed660f66466f192 Mon Sep 17 00:00:00 2001 From: Guoxin Date: Thu, 4 Mar 2021 21:16:02 +0800 Subject: [PATCH] [cluster-utilization] change the get jobs limit to 50000 (#5348) --- src/alert-manager/src/cluster-utilization/send_alert.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alert-manager/src/cluster-utilization/send_alert.py b/src/alert-manager/src/cluster-utilization/send_alert.py index 307f7c6e06..6c08d41372 100644 --- a/src/alert-manager/src/cluster-utilization/send_alert.py +++ b/src/alert-manager/src/cluster-utilization/send_alert.py @@ -12,7 +12,9 @@ QUERY_PREFIX = "/prometheus/api/v1/query" ALERT_PREFIX = "/alert-manager/api/v1/alerts" -REST_JOB_API_PREFIX = "/rest-server/api/v2/jobs" +# only the jobs that are running or completed within 7d should be included +# currently, we just set the limit to max +REST_JOB_API_PREFIX = "/rest-server/api/v2/jobs?limit=50000" TOKEN = os.environ.get('PAI_BEARER_TOKEN') PROMETHEUS_SCRAPE_INTERVAL = int(os.environ.get('PROMETHEUS_SCRAPE_INTERVAL'))