Skip to content

Commit

Permalink
feat(api): grafana extra values (#2979)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Jan 5, 2025
1 parent 8ecb6b8 commit dd60931
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions keep/providers/grafana_provider/grafana_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ def _format_alert(
environment = labels.get(
"deployment_environment", labels.get("environment", "unknown")
)

extra = {}

annotations = alert.get("annotations", {})
if annotations:
extra["annotations"] = annotations
values = alert.get("values", {})
if values:
extra["values"] = values

alert_dto = AlertDto(
id=alert.get("fingerprint"),
fingerprint=fingerprint,
Expand All @@ -227,6 +237,7 @@ def _format_alert(
description=alert.get("annotations", {}).get("summary", ""),
source=["grafana"],
labels=labels,
**extra, # add annotations and values
)
# enrich extra payload with labels
for label in labels:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.33.8"
version = "0.33.9"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
packages = [{include = "keep"}]
Expand Down

0 comments on commit dd60931

Please sign in to comment.