Skip to content

Commit

Permalink
Merge pull request #318 from JamesGibo/alertrules
Browse files Browse the repository at this point in the history
Add alertRuleTags field to graph panel
  • Loading branch information
Daniel Holbach committed Mar 5, 2021
2 parents ed82afc + 1ae3459 commit 5dd490c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog
* Added Cloudwatch metrics datasource (https://grafana.com/docs/grafana/latest/datasources/cloudwatch/)
* Added option to hide dashboard time picker
* Added Notification for Alert
* Added alertRuleTags field to the graph panel

Changes
-------
Expand Down
2 changes: 2 additions & 0 deletions grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ class Graph(Panel):
validator=instance_of(YAxes),
)
alert = attr.ib(default=None)
alertRuleTags = attr.ib(default=attr.Factory(dict))

def to_json_data(self):
graphObject = {
Expand Down Expand Up @@ -1243,6 +1244,7 @@ def to_json_data(self):
}
if self.alert:
graphObject['alert'] = self.alert
graphObject['alertRuleTags'] = self.alertRuleTags
return self.panel_json(graphObject)

def _iter_targets(self):
Expand Down

0 comments on commit 5dd490c

Please sign in to comment.