weaveworks / grafanalib

Python library for building Grafana dashboards
Apache License 2.0
1.87k stars 311 forks source link

Docs Alert example is using non-public API #663

Open j-svensmark opened 3 months ago

j-svensmark commented 3 months ago

In the docs there is an example of how to use the REST API to update an alert rule. The API used in the example (api/ruler/grafana/api/v1/rules) is apparently not intended for public use. Accordingly there doesn't appear to be any documentation of this API in Grafana docs. Example of the code in the docs:

    r = requests.delete(f"https://{server}/api/ruler/grafana/api/v1/rules/{folder}/{groupName}", headers=headers, verify=verify)

Would it be possible to update this example to use the alert provisioning API? https://grafana.com/docs/grafana/v10.4/developers/http_api/alerting_provisioning/

j-svensmark commented 3 months ago

I noticed this issue after upgrading to Grafana 10, and seeing that the alerts we were uploading using Grafanalib were missing. It worked fine in Grafana 9.