-
Notifications
You must be signed in to change notification settings - Fork 318
Fix rendering AlertRulev9 json for possible use in Alerting provisioning API #568
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
2abb9c8
d634ffa
3628021
e4912ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Ilia Ilin <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1602,6 +1602,8 @@ class AlertRulev9(object): | |||
triggers = attr.ib(default=[], validator=is_valid_triggersv9) | ||||
annotations = attr.ib(default={}, validator=instance_of(dict)) | ||||
labels = attr.ib(default={}, validator=instance_of(dict)) | ||||
folderUid = attr.ib(default=None, validator=attr.validators.optional(instance_of(str))) | ||||
ruleGroup = attr.ib(default=None, validator=attr.validators.optional(instance_of(str))) | ||||
|
||||
evaluateFor = attr.ib(default=DEFAULT_ALERT_EVALUATE_FOR, validator=instance_of(str)) | ||||
noDataAlertState = attr.ib( | ||||
|
@@ -1660,7 +1662,9 @@ def to_json_data(self): | |||
"annotations": self.annotations, | ||||
"data": data, | ||||
"noDataState": self.noDataAlertState, | ||||
"execErrState": self.errorAlertState | ||||
"execErrState": self.errorAlertState, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure that this model is correct? According to this API: https://editor.swagger.io/?url=https://raw.githubusercontent.com/grafana/grafana/main/pkg/services/ngalert/api/tooling/post.json looks that grafana_alert object is required for grafana managed alerts 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please could you remove this part from the PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
"folderUid": self.folderUid, | ||||
"ruleGroup": self.ruleGroup, | ||||
} | ||||
|
||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add document string for these