Skip to content

Commit

Permalink
Merge branch 'main' into time_skew_refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyaenr authored Jan 15, 2024
2 parents 0033793 + aa030a2 commit f0ba274
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion run_kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def main(cfg):

# Capture the start time
start_time = int(time.time())

chaos_telemetry = ChaosRunTelemetry()
chaos_telemetry.run_uuid = run_uuid
# Loop to run the chaos starts here
Expand Down Expand Up @@ -338,7 +339,13 @@ def main(cfg):

##PROM
query = r"""ALERTS{severity="critical"}"""
critical_alerts = prometheus.process_prom_query_in_range(query, datetime.datetime.fromtimestamp(start_time))
end_time = datetime.datetime.now()
critical_alerts = prometheus.process_prom_query_in_range(
query,
start_time = datetime.datetime.fromtimestamp(start_time),
end_time = end_time

)
critical_alerts_count = len(critical_alerts)
if critical_alerts_count > 0:
logging.error("Critical alerts are firing: %s", critical_alerts)
Expand Down

0 comments on commit f0ba274

Please sign in to comment.