Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlertRulev9 supports dashbord_uid and panel_uid. #655

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
x.x.x ?
=======

* AlertRulev9 propagates dashbord_uid and panel_uid to the alert rule
* Added ``tooltipSort`` parameter to PieChartv2 panel
* Fix mappings for Table
* Added support for AWS Cross-Account in CloudwatchMetricsTarget
Expand Down
8 changes: 8 additions & 0 deletions grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,12 @@ def to_json_data(self):
else:
data += [trigger.to_json_data()]


JamesGibo marked this conversation as resolved.
Show resolved Hide resolved
if self.dashboard_uid:
self.annotations['__dashboardUid__'] = self.dashboard_uid
if self.panel_id:
self.annotations['__panelId__'] = f"{self.panel_id}"

return {
"uid": self.uid,
"for": self.evaluateFor,
Expand All @@ -1731,6 +1737,8 @@ def to_json_data(self):
"no_data_state": self.noDataAlertState,
"exec_err_state": self.errorAlertState,
},
"dashboardUid": self.dashboard_uid,
"panelId": self.panel_id,
}


Expand Down
Loading