-
Notifications
You must be signed in to change notification settings - Fork 9
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
apps sc: made alert runbooks configurable #2438
base: main
Are you sure you want to change the base?
Conversation
402e518
to
f64f988
Compare
f64f988
to
b581f30
Compare
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.
Nice work, I really like this change. Added some comments, otherwise it looks good
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.
Nice 👍
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.
Nice work! I think that this solution ended up looking very clean.
config/schemas/config.yaml
Outdated
description: |- | ||
Runbooks for alertmanager alerts | ||
|
||
Example: | ||
|
||
group: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/ | ||
AlertmanagerFailedReload: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerfailedreload/ | ||
AlertName: link-to-specific-alert-runbook | ||
|
||
Uses upstream runbooks by default | ||
|
||
https://runbooks.prometheus-operator.dev/runbooks/ |
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.
I think that this description is nice, but I see that this one is the only one with the examples. It would be nice if we had the examples for all groups, not just alertmanager, but I also don't want us to duplicate this text for each.
Suggestion: Could you add this to a template instead and add a reference here? Then we can get it to all without having to duplicate the text. You could have two templates, one with the text about using upstream runbook by default and one without. What do you think about this? Did you already have some similar plan?
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.
Are all these objects different? I wonder if there's any way to have reusable common bits?
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.
The names are a bit different, but I think you could just create an example that is generic and use that for all alerts.
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.
Hm, but for validation? I guess "additionalProperties":{"type":"string"}
might be good enough
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.
Please add a $def
and reuse it for all, and give group
a specific one as it has special handling, else @Zash suggestion is the way to go for map[string]string
for the alerts themselves.
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.
👍 I think this works, at least it validates
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.
Is this still used?
runbookUrl: "https://runbooks.prometheus-operator.dev/runbooks/" |
If not, then I think it can be removed.
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.
I can remove it
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.
config/schemas/config.yaml
Outdated
group: link-to-alert-group-runbook | ||
AlertName: link-to-specific-alert-runbook |
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.
Define this object, also you should move the $def under runbookUrls because it is not going to be used anywhere else.
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.
Define this object
I don't think we should define the object (each alert), to avoid default config clutter.
Or am I missing the point?
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.
You should define group
as a string and define it, then define alerts under additionalProperties
also as a string.
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.
Do you want me to define every single alert?
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.
Is this how you meant? 🙂 6eb927c
Warning
This is a public repository, ensure not to disclose:
What kind of PR is this?
Required: Mark one of the following that is applicable:
Optional: Mark one or more of the following that are applicable:
Important
Breaking changes should be marked
kind/admin-change
orkind/dev-change
depending on typeCritical security fixes should be marked with
kind/security
What does this PR do / why do we need this PR?
Makes it possible to configure runbooks, can be configured on an alert group level or per individual alert.
Current override priority:
Information to reviewers
Checklist