All Products
Search
Document Center

Simple Log Service:Import a Grafana dashboard to Simple Log Service

Last Updated:Aug 29, 2023

This topic describes how to import a Grafana dashboard to Simple Log Service.

Prerequisites

  • 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-panel command to install the Pie Chart plug-in.

Step 1: Obtain the JSON file of a Grafana dashboard

  1. Log on to Grafana.

  2. In the left-side navigation pane, choose image > Browse.

  3. In the list that appears, find and click the required dashboard.

  4. In the upper-right corner of the dashboard, click the image icon.

  5. In the left-side navigation pane, click JSON Model.

  6. 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

  1. Log on to the Log Service console.

  2. In the Projects section, click the required project.

  3. In the left-side navigation pane, click Dashboard.

  4. In the upper-right corner of the Dashboard section, choose image > Import Grafana Dashboard.

  5. 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.

    image
  6. 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.

    导入grafana仪表盘-002-en
    1. In the http:// field, enter Grafana IP address:Port.

    2. 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.

    3. Select the required project and Logstore. Then, click Next.

  7. 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.image

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.

Category

Content supported for conversion

Chart type

  • Time series

  • Bar chart

  • Stat

  • Gauge

  • Bar gauge

  • Table

  • Pie chart

  • Pie chart (old)

  • Text

  • Row

Data source type

  • Prometheus

  • log-service-datasource

Variable

  • Query (The data source must be log-service-datasource.)

  • Custom

  • Text box

Statement conversion

  • SQL

  • PromQL

  • SQL and PromQL

  • Grafana Random Walk

Chart style

Matching in chart positions, sizes, titles, and legends

Limits

  • 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.