By default, the Log Service SLS data source plug-in is installed on the Grafana Service of ARMS. This plug-in allows you to synchronize SLS data and present it in the Grafana dashboard in real time. You do not need to manually obtain or migrate data. This topic describes how to use the SLS data source plug-in to synchronize SLS data and use the SLS data source to create a dashboard panel.

Procedure

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Grafana > Workspaces.
  3. On the Workspaces page, click the ID of the workspace that you want to manage, or click Manage in the Actions column. The Workspaces page appears.
  4. In the left-side navigation pane, click Cloud Service Management.
  5. In the Log Service section of the Cloud Service Management page, click Configuration Management to go to the Grafana data source configuration page.
    Note To log on to Grafana, you can use the Admin account of Grafana and the password that you specified when you created the workspace. Alternatively, you can click Sign in with Alibaba Cloud to log on to Grafana by using the Alibaba Cloud account that you used to purchase the workspace.

Configure data sources

  1. On the Grafana data source configuration page, click Add data source.
  2. In the Others section of the Add data source page, click log-service-datasource.
    Note You can also quickly find the plug-in by entering a log-service-datasource in the search box at the top of the page. Fuzzy search is supported.
  3. On the configuration page of the log-service-datasource, configure the following parameters.
    Parameter Description
    Name The name of the data source. You can define the name of the data source.
    Endpoint Specify this parameter based on the region of the data source used. For more information, see Log Service.
    Project The name of the project to which you want to synchronize data. You can obtain the name of the project in the Project List section of the SLS console.
    Logstore The name of the Logstore that you want to synchronize data in the destination project. Obtain the name of the Logstore that you want to synchronize data in the destination project from the SLS console.
    AccessKeyId Methods to obtain a DRM-encrypted streaming URL:
    1. On the homepage of the SLS console, move the pointer over the profile picture in the upper-right corner of the page. In the dialog box that appears, click AccessKey Management.
    2. After you close the dialog box that appears on the page, click Create AccessKey on the AccessKey page.
    3. In the Phone Verification dialog box, enter the verification code and click OK.
    4. In the Create AccessKey dialog box, copy and record the generated AccessKey ID and AccessKey secret.
    Notice Save the created AccessKey ID and AccessKey secret in a timely manner. After the dialog box is closed, you cannot obtain the relevant information again.
    AccessKeySecret
  4. Click Save & Test.
    Return to the following page, indicating that the configuration is successful. SLS access successful

Create a dashboard panel

Note For more information about how to add other icons, see Add a dashboard.
  1. In the left-side navigation pane of the Grafana console, choose + > Dashboard.
  2. On the New Dashboard page, click Add Empty Panel.
  3. In the Query section of the Edit Panel page, select a log-service-datasource data source from the drop-down list and configure the following parameters.
    Create a panel using an SLS data source
    Parameter Description
    Query Enter the query statement that you want to execute. Example:
    *|select count(*) as c, __time__-__time__%60 as t group by t
    Note For more information about query statements, see Connect to Grafana.
    ycol Enter uv,pv.
    xcol(time) Enter time.
  4. In the right-side pane, specify the name, type, and layout of the monitoring chart.
  5. In the upper-right corner, click Apply.
    The Dashboard panel is created.
  6. In the upper-right corner, click the Save the dashboard icon. Then, specify the name of the dashboard and the directory in which the dashboard resides.
  7. Click Save.
    The dashboard is created.

View monitoring data

  1. In the left-side navigation pane, choose Dashboard > Manage.
  2. On the Manage tab, click Monitoring Dashboard in the target directory.
    View all monitoring charts on the dashboard.