Skip to content

Commit

Permalink
log invalid alert rules (#553)
Browse files Browse the repository at this point in the history
* log invalid alert rules

* bump libpatch

* remove blank line to fix CI
  • Loading branch information
dstathis authored Dec 4, 2023
1 parent c25f7ce commit d29f323
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/charms/prometheus_k8s/v1/prometheus_remote_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 3
LIBPATCH = 4

PYDEPS = ["cosl"]

Expand Down 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
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ pyaml
requests
lightkube >= 0.11
lightkube-models >= 1.22.0.4

# From PYDEPS
importlib-metadata~=6.0.0

0 comments on commit d29f323

Please sign in to comment.