All Products
Search
Document Center

Simple Log Service:Import and export a dashboard

Last Updated:Oct 31, 2024

This topic describes how to import a dashboard within the same Alibaba Cloud account and across multiple Alibaba Cloud accounts. This topic also describes how to import a Grafana dashboard to Simple Log Service and how to import a Simple Log Service dashboard to Grafana.

Import a dashboard within the same Alibaba Cloud account

  1. In the upper-right corner of the Dashboard section, choose + > Import Existing Dashboard.

    image

  2. In the Import Existing Dashboard dialog box, configure the following parameters and click Import. After the dashboard is imported, you are navigated to the dashboard page. The following table describes the parameters.

    image

    Parameter

    Description

    Source Project

    Select the project to which the source dashboard belongs.

    Note

    You can select the current project or a different project.

    Source Dashboard

    Select the source dashboard.

    Dashboard Name

    Enter a name for the new dashboard.

    Logstore Replacement

    If the new dashboard depends on a Logstore in the current project, you can replace the Logstore with a Logstore in the current project. You can replace multiple Logstores.

Import a dashboard across Alibaba Cloud accounts

1. Obtain the JSON file of a dashboard

  1. Open a dashboard. In the upper-right corner of the dashboard page, click Edit to enter the edit mode. For more information, see Edit mode.

  2. In edit mode, click the image icon. On the Dashboard JSON tab of the Dashboard Settings page, copy the JSON-formatted content.

    image

2. Add a JSON dashboard

  1. In the upper-right corner of the Dashboard section, choose + > Add JSON Dashboard.

    image

  2. In the Add to New Dashboard dialog box, paste the JSON-formatted content and click OK. After the dashboard is added, you are navigated to the dashboard page.

    image

Export a Simple Log Service dashboard and import the dashboard to Grafana

Prerequisites

  • Grafana 8.0.0 or later is installed. For more information, see the Grafana documentation.

    Note
    • In this topic, Grafana 9.2.4 is used.

    • If you install Grafana on your computer, you must enable port 3000 in your browser settings.

  • The Simple Log Service plug-in of version 2 is installed. For more information, see Connect Simple Log Service to Grafana.

  • If the Convert to Grafana Dashboard tab is not displayed on the page of your Simple Log Service dashboard, submit a ticket to add the dashboard to the whitelist.

  • If you want to use pie charts, run the grafana-cli plugins install grafana-piechart-panel command to install the pie chart plug-in.

  • If a message indicating a conversion error appears, handle the error based on the message. Otherwise, chart elements may not be displayed as expected.

Limits

  • Grafana does not support the free layout provided by Simple Log Service. After you convert a free-layout Simple Log Service dashboard to a Grafana dashboard, the dashboard layout is disordered.

  • If specific settings such as the x-axis or y-axis setting are missing, chart display issues may occur. In this case, you must check the parameter settings in the Query and Analysis Configurations section.

  • Simple Log Service provides single value charts that allow you to configure various features such as interval-valued comparison, periodicity-valued comparison, and customization. However, Grafana supports only numeric values that are displayed in the charts for conversion.

  • Grafana supports less table settings than Simple Log Service. Specific table settings that Simple Log Service supports are incompatible with Grafana. For example, you cannot configure mini line charts, mini column charts, custom interaction occurrences, or filters for Grafana tables.

  • The details of chart styles such as line types and custom settings are not supported for conversion. After you import a Simple Log Service dashboard, the details of chart styles are displayed based on the default settings of Grafana.

  • Features such as data conversion, interaction occurrences, and field settings that are supported in Simple Log Service cannot be implemented in the same manner in Grafana.

1. Generate and export Grafana-compliant JSON-formatted content

  1. In the dashboard list, click the dashboard that you want to manage and choose Edit > image.

  2. On the Convert to Grafana Dashboard tab, select the version of Grafana that you use. Click Copy Grafana JSON or Download Grafana JSON to obtain the JSON-formatted content.

    image

2. Import the Simple Log Service dashboard to Grafana

  1. Log on to Grafana.

  2. In the left-side navigation pane, choose image > Dashboards. On the dashboard page, choose New > Import.

    image

  3. Click Upload dashboard JSON file to import the JSON file or enter the JSON-formatted content in the Import via panel json field. Then, click Load.

    image

  4. In the Options step, complete the following operations.

    image

    1. Specify a name for the dashboard.

    2. Select a folder in which you want to store the dashboard.

    3. Select a data source for the dashboard.

    4. Click Import.

  5. View the dashboard on the dashboard page after the dashboard is imported.

Conversion scope

When you import a Simple Log Service dashboard to Grafana, only specific chart types, data sources, variables, statements, and chart styles of the Simple Log Service 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

  • Table (Pro)

  • Line chart (Pro)

  • Column chart (Pro)

  • Flow chart (Pro)

  • Single value chart (Pro)

  • Bar gauge (Pro)

  • Pie chart (Pro)

  • Metric Prometheus

  • Table

  • Text

  • Collapsed row

Data source type

  • Logstore (SQL)

  • Metricstore (PromQL)

  • Metricstore (SQL)

  • Builtin

Variable

  • Only variable replacement is supported. Filters are not supported because Grafana does not support filters.

  • A variable cannot use both dynamic and static list items because Grafana does not support the coexistence of query and constant values.

  • When you use variable replacement, you cannot add multiple variables because Grafana does not support custom keys in dashboards.

Statement

  • SQL

  • PromQL

  • SQL and PromQL

Chart style

Matching in chart positions, sizes, titles, and legends

Export a Grafana dashboard and import the 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 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, run the grafana-cli plugins install grafana-piechart-panel command to install the pie chart plug-in.

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

1. Obtain the JSON file of a Grafana dashboard

  1. Log on to Grafana.

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

    image

  3. In the dashboard list, find and click the dashboard that you want to manage. In the upper-right corner of the dashboard page, click the image icon. In the left-side navigation pane of the Settings page, click JSON Model. Copy the JSON-formatted content and save the content as a JSON file or copy the content to the clipboard.

    image

2. Import the Grafana dashboard

  1. In the upper-right corner of the Dashboard section, choose + > Import Grafana Dashboard.

    image

  2. In the Import Grafana JSON step, import the JSON file or enter the JSON-formatted content and click Parse JSON.image

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

    image

    1. In the http:// field, enter Grafana IP address:Port.

    2. Click id Link.

      You are navigated 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. 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.

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

  4. In the Conversion Message step, confirm that an error-free message appears and click Generate Dashboard.

    One of the following messages may appear: a conversion incompatibility message, an error message, an invalid format message, and an error-free message.image

  5. View the dashboard on the dashboard page after the dashboard is imported.

Conversion scope

When you import a Grafana dashboard to Simple Log Service, only specific chart types, data sources, variables, statements, 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

  • SQL

  • PromQL

  • SQL and PromQL

  • Grafana Random Walk

Chart style

Matching in chart positions, sizes, titles, and legends