From 39fae1f3673c5265e2a3f13c06336d59f2d02b8f Mon Sep 17 00:00:00 2001 From: Tullio Sebastiani Date: Wed, 10 Jan 2024 17:07:01 +0100 Subject: [PATCH] fixes prometheus url check on Kubernetes Signed-off-by: Tullio Sebastiani --- run_kraken.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run_kraken.py b/run_kraken.py index afcb05db..990027be 100644 --- a/run_kraken.py +++ b/run_kraken.py @@ -170,7 +170,10 @@ def main(cfg): # KrknTelemetry init telemetry_k8s = KrknTelemetryKubernetes(safe_logger, kubecli) telemetry_ocp = KrknTelemetryOpenshift(safe_logger, ocpcli) - prometheus = KrknPrometheus(prometheus_url, prometheus_bearer_token) + + + if enable_alerts: + prometheus = KrknPrometheus(prometheus_url, prometheus_bearer_token) logging.info("Server URL: %s" % kubecli.get_host()) @@ -337,7 +340,7 @@ def main(cfg): failed_post_scenarios, scenario_telemetries = network_chaos.run(scenarios_list, config, wait_duration, kubecli, telemetry_k8s) # Check for critical alerts when enabled - if check_critical_alerts: + if enable_alerts and check_critical_alerts : logging.info("Checking for critical alerts firing post choas") ##PROM