-
Notifications
You must be signed in to change notification settings - Fork 403
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
docs: add proposal for NotificationPolicyRoute CRD #1789
base: master
Are you sure you want to change the base?
Conversation
As discussed in grafana#1767, this is the proposal for adding a new NotificationPolicyRoute CRD that allows assembling a Notification Policy from individual resources. Please let me know what you think and thanks for your support!
I have a few questions/comments.
|
Thanks, this is good input. I did not look at implementation specifics yet, as I wanted to draft the high-level design first. Definitely makes sense.
Agreed, I'm also all for simplicity here.
I don't have such a use-case at the moment and also did not consider it in the design. Imhop we can start with using the
Yes correct, that was my idea.
Good point, yes we would have to move it to
Thanks, noted! Definitely the resulting routes should be idempotent.
I'm open for input here, but I think your suggestion makes sense. So should we agree on using the |
Actually as I'm working on a draft implementation, I think it makes more sense to go with the My reasoning behind this is the following:
So I think adding an optional Please let me know your thoughts of course, thanks a lot! |
I updated the feature proposal here with what we discussed. Also I have a draft PR that has a working implementation of this feature to support the proposal: #1800 Let me know what you think and thanks for your support! |
I know it has been holiday time, but did someone already get a chance to take a look at this proposal and my draft implementation? What would be the next steps? Thanks a lot for your support! |
Thanks again for all the work put into this, and sorry for the late reply, as you said, the holidays slowed things down quite a bit 😬 Overall, I think this looks very good. My two takes on this are: I'd prefer to see the route selector as a property of the Second, I'd skip the Another thing I'd just like to note which will be relevant to the implementation (no need to address this here, just want to write it down) is to find a way to avoid recursive routes. We'll discuss this topic today in our weekly sync and will get back to you with the next steps |
Sounds good, thanks for reaching out! Looking forward to the outcome of your discussion 😊 I can work on the necessary adjustments, but it could help if you could maybe provide one example to illustrate the behaviour.
To me with the current design we do not really have to think about merging at all, however it will become a bigger factor if we move the If we move the Probably I do not fully understand what you have in mind, so an example will help clear this up 🙂 The current design only allows merging in on one level, which might not solve all requirements, so I understand your concern. |
Sure, my idea would look like this:
The teams can then add their With regard to merging, in your example, the resulting tree has both inline and dynamic rules set. I'd propose to have them mutually exclusive. If you specify Hope this makes sense! |
I would also be fine with adapting this on the current draft I posted, this is not a requirement for me, they could be mutually exclusive. In the example you posted, this will then merge in We discussed something similar to this above with @Baarsgaard
Also in your example, if - object_matchers:
- - team
- =
- first
routeSelector:
team: first Thanks for your help, maybe this can clear a few things up 🙂 |
@theSuess sorry for the ping, but could you elaborate on / clarify the open questions from my last post? |
I do think that it should be possible to specify The downside to this is, as you mentioned, self-referential lookup policies. I think we can avoid this by keeping track of whether the label selector has already appeared previously and disallowing any repetitions |
I understand, but for me its still unclear how your example would render: apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaNotificationPolicy
metadata:
name: grafananotificationpolicy-sample
spec:
route:
receiver: grafana-default-email
group_by:
- grafana_folder
- alertname
routes:
- object_matchers:
- - team
- =
- first
routeSelector:
team: first
- object_matchers:
- - team
- =
- second
routeSelector:
team: second lets imagine there is the following apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaNotificationPolicyRoute
metadata:
name: grafananotificationpolicy-sample
labels:
team: first
spec:
route:
receiver: grafana-another-email
object_matchers:
- - custom
- =
- "matches" What will the resulting Thanks for your help! |
Thanks for clarifying, so the routes from I will try to adapt my draft MR with the changes you mentioned. Thanks for the input! |
As discussed in #1767, this is the proposal for adding a new NotificationPolicyRoute CRD that allows assembling a Notification Policy from individual resources.
Please let me know what you think and thanks for your support!