...
Make sure to create a folder (namespace) for where the alerts need to be imported. Update folderUID and ruleGroup in the alert json to match the folder where you wish to create the alert rule.
If you are unsure what the folderUID is of the destination folder, you can query get it using curl:
Code Block curl -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <API_KEY>' \ -X GET http://<cluster-address>/grafana/api/folders
If you don’t have a ruleGroup, you can create one following these instructions.
If using command line (using the HTTP API), you will need an API key with admin privilege. You can create an API key by following these instructions.
Code Block # the curl command to import alerts. curl -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <API_KEY>' \ -X POST http://<cluster-address>/grafana/api/rulerv1/grafana/api/v1/rules/<NAMESPACE>provisioning/alert-rules -d @<converted-file-location.json>
...