grafana-operator icon indicating copy to clipboard operation
grafana-operator copied to clipboard

Add an option to disable editing alert rules declared by GrafanaAlertRuleGroup resource

Open chenlujjj opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. We used GrafanaAlertRuleGroup CR to manage alert rules, but the rules created can be edited by users from UI, which may make the status inconsistency.

Describe the solution you'd like Add an option to disable editing alert rules from UI.

chenlujjj avatar Oct 10 '24 08:10 chenlujjj

cc @theSuess

chenlujjj avatar Oct 10 '24 08:10 chenlujjj

Thanks for reporting this issue! We are currently focused on the UID refactoring so we won't have time for this soon but are more than happy to review/accept a PR regarding this.

Should be pretty straight forward:

  1. Add the field to the api spec
  2. Set the value of the provenance field accordingly https://github.com/grafana/grafana-operator/blob/5851fe416c91432412bee6c86de9515c90148cb1/controllers/grafanaalertrulegroup_controller.go#L227

theSuess avatar Oct 14 '24 09:10 theSuess

@theSuess Thanks, I can work on it

chenlujjj avatar Oct 14 '24 10:10 chenlujjj

We are currently focused on the UID refactoring

BTW, are you referring to the issue that users must set UID in the CR definition? Previously I assumed the grafana backend can generate those uids

chenlujjj avatar Oct 14 '24 12:10 chenlujjj

Raised a PR: https://github.com/grafana/grafana-operator/pull/1715

chenlujjj avatar Oct 15 '24 05:10 chenlujjj

We are currently focused on the UID refactoring

BTW, are you referring to the issue that users must set UID in the CR definition? Previously I assumed the grafana backend can generate those uids

Hi @theSuess , I checked the documentation of provisioning http API: https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/http-api-provisioning/#span-idprovisioned-alert-rulespan-provisionedalertrule, seems that the UID of alert rule is not a REQUIRED field.

Is it possible to omit the uid when declaring CR ?

chenlujjj avatar Oct 18 '24 11:10 chenlujjj

Is it possible to omit the uid when declaring CR? Currently, we need the UID to compute the delta. If there is another way, I'm all for it

Closing this as #1715 has been merged

theSuess avatar Feb 19 '25 12:02 theSuess