Import dashboards within or across Alibaba Cloud accounts. Convert dashboards between Simple Log Service and Grafana.
Import a dashboard within the same Alibaba Cloud account
-
On the right side of the Dashboard area, select .
-
In the Import Dashboard dialog box, configure the following parameters and then click Import. After the dashboard is imported, you are redirected to the dashboard page.
Parameter
Description
Source Project
Select the project that contains the source dashboard.
NoteThe source can be the current project or a different project.
Source Dashboard
Select the source dashboard.
Dashboard Name
Enter a name for the new dashboard.
Logstore Replacement
Replace the source Logstore with one from the current project if the dashboard depends on it. Multiple replacements are supported.
Import a dashboard across Alibaba Cloud accounts
1. Obtain the JSON file of a dashboard
-
On the target dashboard page, click Edit in the upper-right corner to enter edit mode.
-
In edit mode, click the
icon. On the Dashboard JSON tab of the Dashboard Settings page, copy the JSON content.
2. Add a JSON dashboard
-
On the right side of the Dashboard area, select .
-
In the Add to New Dashboard dialog box, paste the JSON and click Confirm. You are redirected to the new dashboard.
Set Operation Type to Create Dashboard, select a Layout Mode (Grid Layout or free layout), and enter a Dashboard Name. You can view or edit the dashboard JSON, including
displayName,attribute.type, and query parameters incharts.
Export an SLS dashboard to Grafana
Prerequisites
-
Grafana 8.0.0 or later is installed (Grafana documentation).
Note-
This topic uses Grafana 9.2.4.
-
If Grafana is installed locally, enable port 3000 in your browser.
-
-
The SLS plug-in for Grafana (version 2) is installed. Connect to Grafana.
-
If the Convert to Grafana Dashboard tab is not available, submit a ticket to enable it for your account.
-
To use pie charts, install the pie chart plug-in:
grafana-cli plugins install grafana-piechart-panel. -
If a conversion error appears, resolve it before proceeding. Unresolved errors may cause chart elements to display incorrectly.
Limits
-
Grafana does not support the SLS free layout. Converting a free-layout dashboard results in a disordered layout.
-
Missing axis configuration can cause display issues. Check the Query and Analysis Configurations if this occurs.
-
SLS single value charts support interval-valued comparison, periodicity-valued comparison, and customization. Grafana converts only the numeric values.
-
Grafana supports fewer table settings than SLS. Mini line charts, mini column charts, custom interactions, and filters are not supported.
-
Chart style details such as line types and custom settings are not converted. Imported dashboards use Grafana default styles.
-
SLS features such as data conversion, interaction occurrences, and field settings cannot be fully replicated in Grafana.
1. Export Grafana-compliant JSON
-
In the dashboard list, click the target dashboard, and then click .
-
On the Convert to Grafana Dashboard tab, select your Grafana version. Click Copy Grafana JSON or Download Grafana JSON to get the JSON content.
SLS query syntax requires the corresponding Grafana plugin. Grafana 8.0.0 or later is required. Version 8.3.x is not recommended.
2. Import the Simple Log Service dashboard to Grafana
-
Log on to Grafana.
-
In the left-side navigation pane, choose . On the dashboard page, choose .
-
Click Upload dashboard JSON file to import the JSON file, or paste the JSON content into the Import via panel json text box, and then click Load.
Alternatively, you can enter a dashboard URL or ID from Grafana.com in the Import via grafana.com field and click Load.
-
In the Options section, configure the following settings.
-
Name the dashboard.
-
Select a folder for the dashboard.
-
Select a data source.
-
Click Import.
-
-
View the imported dashboard on the dashboard page.
Conversion scope
Import a Grafana dashboard to SLS
Prerequisites
-
Grafana 8.0.0 or later is installed (Grafana documentation).
This topic uses Grafana 9.2.4.
ImportantIf Grafana is installed locally, enable port 3000 in your browser.
-
The SLS plug-in for Grafana (version 2) is installed. Install the Simple Log Service plug-in.
-
To use pie charts, install the pie chart plug-in:
grafana-cli plugins install grafana-piechart-panel.
Limits
-
Grafana dashboard variables do not support the Prometheus data source. Use log-service-datasource instead.
-
Chart style details such as line types and custom settings are not converted. Imported dashboards use SLS default styles.
-
Grafana features such as Transform, Expression, Annotations, Links, and Permissions cannot be fully replicated in SLS.
1. Export the Grafana dashboard JSON
-
Log on to Grafana.
-
In the left-side navigation pane, choose .
-
Open the target dashboard. Click the
icon in the upper-right corner. On the settings page, click JSON Model in the left navigation pane. Copy the JSON content to a file or clipboard.
2. Import the Grafana dashboard
-
On the right side of the Dashboard area, select .
-
In the Import Grafana JSON step, use Import from File (JSON files smaller than 10 MB) or Import by Entering JSON to provide the dashboard JSON, then click Parse JSON. The converted time range defaults to "Last 15 minutes".
-
In the Select Logstore step, complete the following configurations.
SLS automatically parses the JSON to identify the data source ID or name. Use this to locate the associated project and Logstore.
-
In the http:// field, enter
Grafana IP address:Port. -
Click the ID link.
This opens the Grafana data source settings page, which shows the associated SLS project and Logstore. Grafana displays a data source ID or name depending on your version. This example uses the data source ID.
-
Select the target project and Logstore, then Next.
-
-
In the Conversion Message step, confirm that no errors are reported, and then click Generate Dashboard.
Results may include incompatibility warnings, error messages, format correction suggestions, or a confirmation that no errors were found.
-
View the imported dashboard on the dashboard page.
