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
Alerting: Allow none provenance alert rule creation from provisioning API #58410
Alerting: Allow none provenance alert rule creation from provisioning API #58410
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41319 |
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 just saw that you edited a generated file (pkg/services/ngalert/api/generated_base_api_provisioning.go
). This should not be done. You will need to look at another way to do this.
You could i.e. extend the generation template to consider headers when generating handlers. The codegen code can be found in grafana/pkg/services/ngalert/api/tooling
I didn't notice it was generated even though it says in the name of the file. Thanks. |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41708 |
b212ef6
to
ce0eea6
Compare
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41715 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41742 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41749 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41754 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41772 |
The changes look good to me! |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41812 |
…ame to const, and avoid boolean parameter
…ovisioning API and tests for that cases
1e16b61
to
13873f2
Compare
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41883 |
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
Please explain, how it will help with Terraformed alerts? |
There is no workaround to do it directly from terraform. This is API only. |
@greatvovan @alexmobo Actually, this is possible. The grafana terraform provider allows you to provide any set of custom headers via the See the option docs here: |
hey @alexweav any chance you could confirm this is how it should be set?
running 9.3.0 i tried remove some alerts and recreating but sadly still complained it was provisioned still |
i just tried it with grafana v9.4.3 and terraform provider v1.35.0, both are latest, and it doesn't work
while working with api directly works Please review and let me know if there is some other way of doing this. Thanks |
@nitesh8860 thanks for trying also, i think this might actually be an issue to be raised for the terraform provider instead |
I'm using For dashboards, I use |
What is this feature?
There has been some pain around being able to modify alerts created via API lately. Since our Alerting API is not stable just yet we are enabling a workaround within the Provisioning API to do it by adding the
x-disable-provenance
header to the following requests:POST /api/v1/provisioning/alert-rules
PUT /api/v1/provisioning/alert-rules/{UID}
This will create alert rules as if they were created via UI and make the editable.
Why do we need this feature?
Many clients are asking to be able to create editable alert rules from the API.
Who is this feature for?
Users that want to edit API-created alert rules using the UI.
Which issue(s) does this PR fix?:
Fixes #57911