This topic describes how to import a Grafana dashboard to Simple Log Service.
Grafana 8.0.0 or later is installed. For more information, see the Grafana documentation.
In this topic, Grafana 9.2.4 is used.Important
If you install Grafana on your computer, you must enable port 3000 in your browser settings.
The Simple Log Service for Grafana plug-in of version 2 is installed. For more information, see Install the Simple Log Service plug-in.
If you want to use pie charts, you can run the
grafana-cli plugins install grafana-piechart-panelcommand to install the Pie Chart plug-in.
Step 1: Obtain the JSON file of a Grafana dashboard
Log on to Grafana.
In the left-side navigation pane, choose > Browse.
In the list that appears, find and click the required dashboard.
In the upper-right corner of the dashboard, click the icon.
In the left-side navigation pane, click JSON Model.
Copy the JSON-formatted content and store the content as a JSON file or copy the content to the clipboard.
Step 2: Import the Grafana dashboard
Log on to the Log Service console.
In the Projects section, click the required project.
In the left-side navigation pane, click Dashboard.
In the upper-right corner of the Dashboard section, choose > Import Grafana Dashboard.
In the Import Grafana JSON step, import the JSON file or enter the JSON-formatted content and click Parse JSON.
The JSON-formatted content is obtained in Step 1: Obtain the JSON file of a Grafana dashboard.
In the Select Logstore step, complete the following operations.
Simple Log Service automatically parses the JSON-formatted content to obtain the data source ID or data source name of the dashboard. You can obtain the project and Logstore that are associated with the data source based on the data source ID or data source name of the dashboard.Important
The information that Simple Log Service obtains from the JSON-formatted content varies based on the version of Grafana. In this example, a data source ID is obtained.
In the http:// field, enter
Grafana IP address:Port.
Click id Link.
You are redirected to the page on which you can configure settings for your Grafana data source. You can view the Simple Log Service project and Logstore that are associated with the data source.
Select the required project and Logstore. Then, click Next.
In the Conversion Message step, confirm that an error-free message appears and click Generate Dashboard.
One of the following messages can appear: a conversion incompatibility message, an error message, an invalid format message, and an error-free message.
After the dashboard is imported, you are redirected to the dashboard page. You can view the imported dashboard on the dashboard page.
Content supported for conversion
When you import a Grafana dashboard to Simple Log Service, only some chart types, data sources, variables, statement conversion, and chart styles of the Grafana dashboard are supported for conversion because of the differences in implementation and features between Grafana and Simple Log Service. The following table describes the content that is supported for conversion.
Content supported for conversion
Data source type
Matching in chart positions, sizes, titles, and legends
When you import a Grafana dashboard, the Prometheus data source is not supported by the variables of the Grafana dashboard. You must use log-service-datasource.
The details of chart styles such as line types and custom details are not supported for conversion. After you import a Grafana dashboard, the details of chart styles are displayed based on the default settings of Simple Log Service.
Features such as Transform, Expression, Annotations, Links, and Permissions that are supported in Grafana cannot be implemented in the same manner in Simple Log Service.