Import Grafana dashboards into Cloud Monitoring Stay organized with collections Save and categorize content based on your preferences.
This document describes how to import dashboard files in theGrafana JSON format into Cloud Monitoring. You canimport Grafana dashboards in the following ways:
The import process converts dashboard files in the JSON format used by Grafanainto the JSON format used by Cloud Monitoring. A converted dashboardmight differ from the original Grafana dashboard. If, for example, a Grafanadashboard uses features that aren't available in Cloud Monitoring dashboards,then those aspects of the Grafana dashboard are not converted. These differencesare listed in the results of the import.
You can only import dashboards that use PromQL expressions and Prometheusdata sources. Dashboards that use other forms of querying or data sources mightnot import successfully.
For information about importing Prometheus alerts into Cloud Monitoring, seeMigrate alerting rules and receivers from Prometheus.
For general information about managing your imported dashboards, seeCreate and manage custom dashboards.
Before you begin
Whether you use the Google Cloud console or the importer tool to importyour dashboards, you must have sufficientauthorization, and youneeddashboards to import. When using the importertool, there areadditional prerequisites.
Authorization
To get the permissions that you need to create and modify custom dashboards, ask your administrator to grant you theMonitoring Editor (roles/monitoring.editor) IAM role on your project. For more information about granting roles, seeManage access to projects, folders, and organizations.
You might also be able to get the required permissions throughcustom roles or otherpredefined roles.
For more information about roles, seeControl access with Identity and Access Management.
Collect the Grafana dashboards to import
To import Grafana dashboards, you must have them stored locally asfiles in JSON format. You might want to create a directory specificallyfor these dashboard files.
Import dashboards by using the Google Cloud console
You can import Grafana dashboards into Cloud Monitoring from theMonitoringDashboards page in the Google Cloud console.
Import Grafana dashboards
To import one or more Grafana dashboards, do the following
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
In the toolbar of the Google Cloud console,select your Google Cloud project. ForApp Hubconfigurations, select the App Hub host project or management project.
ClickImport Dashboard.
ClickBrowse to navigate to the directory where you have stored yourGrafana dashboards in JSON format, and select the dashboards you want toimport.
Each JSON file is staged after it is selected; theStaged Filespane indicates whether there are any issues in the conversion.
- Clickcode View converted JSON to see the results of the conversion.
- Clickclose Remove file to remove a dashboard from the import operation.
Clicksave_alt Import. TheImport results pane indicates whether ornot each dashboard has been successfully imported.
To view a successfully imported dashboard, clickopen_in_new View.
View your imported dashboards
To view your imported dashboards, do the following:
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
- In the toolbar of the Google Cloud console,select your Google Cloud project. ForApp Hubconfigurations, select the App Hub host project or management project.
Locate the dashboard that you want to view in the list.To filter the list of dashboards, you can do the following:
- In theType menu, selectCustom.
In theLabels pan, select the
Note: You can also create your own labels and add them to customdashboards, like Grafana dashboards that you import. Labels can helpyou manage your dashboards. For example, you might add the labelcloud-monitoring-dashboard-importerlabel to see onlyGrafana dashboards imported by using the Google Cloud console.prodto dashboards that display information about production systems.Use the filter bar search by name.
Add or remove user-defined labels
You can add labels only to custom dashboards, which include dashboards thatyou import. When a dashboard displays theAdd labels to dashboard button, then you canconfigure which labels are applied to the dashboard.
To add or remove user-defined labels to a dashboard, do the following:
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
- In the list of dashboards, locate the dashboard and then clickAdd labels to dashboard.
- Do one of the following:
To create a label and add it to your dashboard, in theCreate a new label section, enter the name of the label in the textbox and then clickCreate and apply.
- To configure which labels are added to your dashboard, clickarrow_drop_downSelect labels to apply, select the labels, and then clickOk.
- To save your changes, clickConfirm.
Import dashboards by using the importer tool
You can use the importer tool to convert Grafana dashboards and upload themto Cloud Monitoring as a single operation, or you can perform theconversion and upload steps separately. You might choose this approach if youwant to edit the converted dashboards before uploading them.
Additional prerequisites
Before you can install and run the dashboard importer,you must do the following:
- Use an environment that supportsBash shellscripts.
- Have orinstall Git.
- Have orinstall Node.js, version 20.4.1 ornewer.
- Have orinstall the Google Cloud CLI. If you already havethe gcloud CLI installed, ensure that you have the latestversion by running the
gcloud components updatecommand.
Obtain the dashboard importer
The dashboard importer is stored in themonitoring-dashboard-samplesGitHub repository.To obtain and set up the importer, do the following:
Clone the repository:
git clone https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples
Change to the directory for the dashboard importer:
cd monitoring-dashboard-samples/scripts/dashboard-importer
Install the node modules and build the files
npm install && npm run build
The dashboard importer includes the following scripts:
import.sh, which converts dashboards andoptionally uploads the converted dashboards to Cloud Monitoring.upload.sh, which uploads the converteddashboards—or any Monitoring dashboards—toCloud Monitoring. Theimport.shscript calls thisscript to do the upload.
When you use theimport.sh script, you must specify thelocation of the Grafana dashboards to convert. The importer creates adirectory that contains the converted dashboards and other information.The following sections describe these directories.
Grafana dashboards to convert
You can use the dashboard importer to convert one or more dashboards ata time by specifying a path to the dashboards files.
You can specify the path to a directory that contains dashboards.Only files in the directory that have the
.jsonextension are processed.You can specify the path to a single JSON file. The filename must havethe
.jsonextension.
Converted dashboards and other information
When the importer runs the first time, it creates areports subdirectory.Every time you run the importer, you get a new output directory under thereports directory, named by the date and time. The name of the outputdirectory has the following structure:reports/YYYY-M-D/HH:MM:SS
For each invocation of the importer, the output directory contains thefollowing:
- A file or files with the same names as the original Grafana dashboards, butnow in Cloud Monitoring JSON format.
- A
report.jsonfile, which records the following informationfor each converted dashboard:- The name and location of the Grafana dashboard file that was converted.
- The name and location of the converted Monitoring dashboardfile.
- Notices about any features in the Grafana dashboard that have nocorresponding feature in Cloud Monitoring and therefore couldn'tbe included in the converted dashboard.
- Any errors that occurred in the conversion.
If you have uploaded the dashboards, the report directory also includesanupload_HH:MM:SS.txt file, which includes the URL to whichthe dashboard was uploaded.
Import Grafana dashboards
To convert Grafana dashboards and upload them to Cloud Monitoring, usetheimport.sh script:
./import.shPATH_TO_DIRECTORY_OR_FILEPROJECT_ID
This script does the following:
- Converts dashboards in
PATH_TO_DIRECTORY_OR_FILEfrom the JSON formatused by Grafana into the JSON format used by Cloud Monitoring. Uploads the converted dashboards into your Google Cloud projectPROJECT_IDby using the Google Cloud CLI.
If you have not authenticated to the gcloud CLI, then run the
gcloud auth logincommand before running theimport.shscript.
You can import all the Grafana dashboards in a directory, or you can specify asingle dashboard in the directory to import.
To import all the dashboards in the
GRAFANA_DASHBOARDS_DIRdirectoryinto thePROJECT_ID Google Cloud project,specify the directory, relative to the importer directory, and thedestination project ID when invoking the script:./import.shGRAFANA_DASHBOARDS_DIRPROJECT_ID
To convert only the
MY_GRAFANA_DASHBOARD.jsondashboard in theGRAFANA_DASHBOARDS_DIRdirectory, include the dashboard filename,relative to the importer directory, when invoking the script:./import.shGRAFANA_DASHBOARDS_DIR/MY_GRAFANA_DASHBOARD.jsonPROJECT_ID
The dashboard importer includes a sample Grafana dashboard asexamples/k8s_cluster_example.json. The following command importsthat dashboard into the specified project:
./import.sh examples/k8s_cluster_example.jsonPROJECT_ID
When invoked with thePROJECT_IDmy-project-test-1, the output resemblesthe following:
Converting: Kubernetes Cluster Overview✓ Kubernetes Cluster Overview converted successfullyConversion of examples/k8s_cluster_example.json complete. Conversion Report located at: reports/2023-9-28/22:14:57/report.jsonTo upload these dashboard(s) manually, you can run:./upload.sh reports/2023-9-28/22:14:57/ <PROJECT_ID>Conversion Complete. Proceeding to uploading...Now running: ./upload.sh reports/2023-9-28/22:14:57/ my-project-test-1Uploading 1 dashboard(s) from a directory with the following args:Directory: reports/2023-9-28/22:14:57/Project: my-project-test-1The following are your dashboards:- k8s_cluster_example.json
After theimport.sh script has created the output directoryand converted the dashboards, but before it uploads the converted dashboardsto your project, it prompts you for confirmation. Entery, and the scriptuploads the dashboard and prints the URL for the new dashboard:
Would you like to continue? (y/n) y✓ k8s_cluster_example.json successfully uploaded:https://console.cloud.google.com/monitoring/dashboards/builder/9c341ef8-cfef-4bdd-98d5-821571c520ef?project=my-project-test-1Upload log created in reports/2023-9-28/22:14:57/upload_22:14:57.txtNeed to troubleshoot? Please visit:https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples/tree/master/scripts/dashboard-importer/README.md#troubleshooting
Convert Grafana dashboards without uploading
If you want to inspect or edit the converted dashboards before uploadingthem, then omit thePROJECT_ID value when invoking theimport.sh script:
./import.shPATH_TO_DIRECTORY_OR_FILE
The importer converts the dashboards as described inImport Grafana dashboardsbut does not upload the converted dashboards to Cloud Monitoring.
You can run the upload step later, by using theupload.shscript manually.
Upload dashboards manually
To manually upload dashboards in Cloud Monitoring JSON format, usetheupload.sh script.
./upload.shPATH_TO_DIRECTORY_OR_FILEPROJECT_ID
Theupload.sh script uses the Google Cloud CLIto upload the JSON files. If you have not authenticated to thegcloud CLI, then run thegcloud auth logincommand before running theupload.sh script.
To upload all the dashboards in a
reports/YYYY-M-D/HH:MM:SSdirectory,specify the directory, relative to the importer directory, andthe destination project ID when invoking the script:./upload.sh
reports/YYYY-M-D/HH:MM:SSPROJECT_IDWhen uploading all dashboards from a directory, the scriptprompts you to continue or exit before uploading the dashboards.
To upload a specific dashboard in a
reports/YYYY-M-D/HH:MM:SSdirectory,specify the directory and filename, relative to the importer directory, andthe destination project ID when invoking the script:./upload.sh
reports/YYYY-M-D/HH:MM:SS/MY_MONITORING_DASHBOARD.jsonPROJECT_IDWhen uploading a single dashboard from a directory, the scriptruns without prompting you before uploading the dashboards.
For example, the following command uploads a dashboard storedin areports subdirectory to the Google Cloud projectmy-project-test-1:
./upload.sh reports/2023-9-26/22:48:31/k8s_cluster_example.json my-project-test-1Uploading json file: k8s_cluster_example.json to project: my-project-test-1...✓ k8s_cluster_example.json successfully uploaded:https://console.cloud.google.com/monitoring/dashboards/builder/25956d9a-93e2-410c-ada1-ec6872cb6665?project=my-project-test-1
View your uploaded dashboards
To view your uploaded dashboards, do the following:
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading isMonitoring.
Locate the dashboard that you want to view in the list.To filter the list of dashboards, you can do the following:
- Select theCustom category to see only user-defined dashboards.
- Select the
cloud-ops-grafana-importerlabel to see only Grafanadashboards imported by using the importer tool. - Use the filter bar search by name.
Troubleshooting
We occasionally publish small updates and bug fixes to the tool. Beforeattempting further troubleshooting, first try fixing the issue byusinggit pull to pull down the latestversion of the repository and then importing again.
For information about problems with the converted dashboards,such as charts not showing data, see the importer'sREADME file.
What's next
- Create and manage custom dashboards
- Migrate alerting rules and receivers from Prometheus
- View and manage metric usage
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.