-
Notifications
You must be signed in to change notification settings - Fork 377
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
Feature/grafana8 unified alerting #559
Feature/grafana8 unified alerting #559
Conversation
Is it worth adding some logic to give an error if both |
I think this is a good idea. I would ask for a bit of guidance as a) I'm very new to golang and have no clue what proper exception throwing/handling practices are and b) am unsure of any conventions or contextual implications of doing so within this system based on where the code executes Behaviorally, would we want this to error if the user provides mutual-inclusive settings that won't work? Or we could assume that the more opt-in nature of unified_alerting is what they wanted and log a warning that we are unsetting the alerting flag and do that for them. Conceptually something like
I get that the syntax of |
My general philosophy when it comes to microservices is to fail loudly, rather then generating logs so I don't think the grafana instance should be created at all if both the values are set. It possible to solve this in OpenAPIv3 so we don't have to add any logic at all Another solution would be to use a controller level//admission webhook level but I think that would create more complexity then we want right now. I think to automatically set I have been looking for a good place where we could put some kind of logic to return a error in a good way but I'm unable to do so from the top of my head. |
Your points make good sense. Given that the error logic here depends upon the fully built configuration (wanting to avoid any order-of-operations issues), perhaps at the end of config construction a single error check call could be made wrapping these various confirmations. In this case, if both flags are set you return an error. If the check returns no errors (aka they are nil) you proceed - otherwise yell loudly and fatally exit. |
I like the idea of a loud failure in the case of the ini, I think we could possibly add some logic that would fatal out in case of a misconfiguration, we already have similar logic when we define certain flags at the same time, so we can definitely do it here as well. My one requirement would be that we give a decent description of the misconfiguration issue and how to fix it in the log message. |
Will this one be backported to v3? |
Only critical bug fixes are backported to v3, so no. |
We have had some more internal discussions and in general the operator don't provide logic for users to not make errors. Instead we forward all config to grafana, we will keep on doing this in this case as well. We will release 4.0.2 (a few bug fixes that we want released) first when that is done we will merge this PR after a second review. |
is there a way to override the config to have this enabled using a custom.ini config with this operator? |
@NissesSenap any update as v4.0.2 is now released? |
I will look through later tonight but if I remember correctly all is fine. |
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.
LGTM i removed the update of go.mod, and running go mod tidy
didn't bring em back and I can't see why your change would need em.
I do enjoy the \n in .gitignore.
Great job and sorry for the delay @apryor6
Woo hoo. Thanks very much |
Description
This implements parameter support to grafana.ini for Unified Alerting in Grafana 8 -> docs here
Relevant issues/tickets
None but was discussed in #grafana-operator slack
Type of change
Checklist
Verification steps
A minimal deployment that leverages this would be something like
Note, per the docs, you MUST simultaneously enable
unified_alerting
and disablealerting