Skip to content

Commit

Permalink
log invalid alert rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dstathis committed Nov 30, 2023
1 parent c25f7ce commit 40fbc7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/charms/prometheus_k8s/v1/prometheus_remote_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ def alerts(self) -> dict:

_, errmsg = self._tool.validate_alert_rules(alert_rules)
if errmsg:
logger.error(f"Invalid alert rule file: {errmsg}")
if self._charm.unit.is_leader():
data = json.loads(relation.data[self._charm.app].get("event", "{}"))
data["errors"] = errmsg
Expand Down

0 comments on commit 40fbc7b

Please sign in to comment.