Dashboards
Grafana Dashboards can easily be exported and imported, either from the UI or from the HTTP API
If using UI, the converted dashboards can be imported to grafana in your environment by simply following instructions from Grafana found here.
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. Also, you will need a folder to have been created to which the alerts will be With the API key generated, use following command to import the provided/converted grafana dashboard:
# the curl command to import dashboard curl -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <API_KEY>' \ -X POST http://<cluster-address>/grafana/api/dashboards/db -d @<converted-file-location.json>
Alerts
Note that following is intended to import to Grafana as per Grafana Alert Provisioning API. If you are importing the alerts definition to Prometheus server directly, the input format (i.e., the converted file) is different. Please make sure to communicate with Kloudfuse team prior to conversion to ensure that you have the correct format of the converted files.
Please follow these steps to import the grafana alerts to your grafana instance.
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:
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 created already, you can create one by 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.
curl -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <API_KEY>' \ -X POST http://<cluster-address>/grafana/api/v1/provisioning/alert-rules -d @<converted-file-location.json>