All Products
Search
Document Center

Application Real-Time Monitoring Service:Add and use a Tablestore data source

Last Updated:Mar 24, 2025

By default, Managed Service for Grafana is integrated with Alibaba Cloud Tablestore. You can use the Tablestore plug-in to synchronize data from Tablestore to Grafana and display data in Grafana dashboards. This topic describes how to synchronize data from Tablestore to Grafana and use a Tablestore data source to create a dashboard panel.

Background information

Tablestore is a storage service that is developed by Alibaba Cloud. Tablestore can store large amounts of structured data by using multiple models, and supports fast data queries and analytics. Tablestore uses a distributed storage architecture and an index-based search engine. Tablestore can store petabytes of data and process tens of millions of transactions per second (TPS) at an ultra-low latency of milliseconds.

Prerequisites

  • A Grafana workspace is created.

  • If you are using Grafana V11.4.x, make sure to first enable AngularJS, which is disabled by default, for Tablestore data sources to be properly used.

    1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Grafana > Workspace Management.

    2. On the Workspace Management page, click the workspace ID of Grafana V11.4.x that you want to manage.

    3. In the left-side navigation pane, click Parameter Settings. In the panel that appears, click Modify Parameters. Then, select security, set angular_support_enabled to true, and click Save and Apply.92

Step 1: Log on to Grafana

  1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Grafana > Workspace Management.

  2. On the Workspace Management page, find the workspace that you want to manage and click the URL in the URL column to go to Grafana.

    Note

    You can log on to Grafana with the administrator account of Grafana and the password that you configured when you created the workspace. You can also click Sign in with Alibaba Cloud to log on to Grafana with the current Alibaba Cloud account.

Step 2: Add a data source

Grafana V11.x

  1. In the left-side navigation pane, choose Connections > Data sources.

  2. On the page that appears, click Add new data source.

  3. On the Add data source page, search for and click aliyun-tablestore-grafana-datasource.

  4. On the Settings tab, set the following parameters.

    Parameter

    Description

    Name

    The name of the data source. You can specify a custom name. In this example, aliyun-tablestore-grafana-datasource is used.

    Endpoint

    The endpoint of the Tablestore instance. For information about how to obtain the endpoint, see the "Query endpoints" section of the Endpoints topic.

    Instance

    The name of the Tablestore instance.

    AccessId

    The AccessKey ID of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    AccessKey

    The AccessKey secret of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    image

  5. Click Save & test.

    If the Data source is working message appears, the data source is added.

Grafana V10.0.x

  1. On the Grafana homepage, click the image icon.

  2. In the left-side navigation pane, choose Management > Data sources.

  3. On the Data sources page, click + Add new data source.

  4. On the Add data source page, search for and click aliyun-tablestore-grafana-datasource.

  5. On the Settings tab, set the following parameters.

    Parameter

    Description

    Name

    The name of the data source. You can specify a custom name. In this example, aliyun-tablestore-grafana-datasource is used.

    Endpoint

    The endpoint of the Tablestore instance. For information about how to obtain the endpoint, see the "Query endpoints" section of the Endpoints topic.

    Instance

    The name of the Tablestore instance.

    AccessId

    The AccessKey ID of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    AccessKey

    The AccessKey secret of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    image

  6. Click Save & test.

    If the Data source is working message appears, the data source is added.

Grafana V9.0.x

  1. In the left-side navigation pane, move the pointer over the image icon and select Data sources. On the Data sources tab, click Add data source.

  2. On the Add data source page, search for and click aliyun-tablestore-grafana-datasource.

  3. On the Settings tab, set the following parameters.

    Parameter

    Description

    Name

    The name of the data source. You can specify a custom name. In this example, aliyun-tablestore-grafana-datasource is used.

    Endpoint

    The endpoint of the Tablestore instance. For information about how to obtain the endpoint, see the "Query endpoints" section of the Endpoints topic.

    Instance

    The name of the Tablestore instance.

    AccessId

    The AccessKey ID of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    AccessKey

    The AccessKey secret of the Alibaba Cloud account used to access the Tablestore instance. For information about how to obtain an AccessKey pair, see Obtain an AccessKey pair.

    image

  4. Click Save & test.

    If the Data source is working message appears, the data source is added.

Step 3: Create a dashboard panel

Grafana V11.x

  1. In the left-side navigation pane, click Dashboards. On the page that appears, choose New > New dashboard in the upper-right corner.

  2. On the New dashboard page, click + Add visualization.

  3. On the Select data source page, select the data source that you added in Step 2.

  4. Configure the parameters in the following table and click Run SQL.

    Parameter

    Description

    Query

    The SQL statement. For more information, see SQL query.

    Example:

    SELECT
      *
    FROM
      your_table
    WHERE
      $__unixMicroTimeRangeFilter(_time)
      AND _m_name = "your_measurement"
      AND tag_value_at(_tags, "your_tag")="your_tag_value"
    LIMIT 1000
    Note
    • In the WHERE clause, the time range condition that is used to filter data is specified by using a predefined macro. In this example, the predefined macro is $__unixMicroTimeRangeFilter. For more information, see Use SQL to query time series data.

    • If you want data to be displayed in a time series chart, a time column that uses timestamps must be returned. You must specify the name of the time column.

    Format As

    The format of the results. Valid values:

    • Timeseries: displays the query results in a regular time series chart.

    • FlowGraph: displays the query results in a multi-dimensional chart.

    • Table: displays the query results in a regular table.

    Time Column

    The name of the time column in the query results that are returned. The time column is used as the x-axis of the time series chart.

    Aggregation Column

    This parameter is required if the Format As parameter is set to FlowGraph. This parameter is used to convert data in multiple rows of a single column at a specific point in time into data in multiple columns of a single row at the specified point in time. This parameter is suitable for converting data that uses a single-value model into data that uses a multi-value model. Data that uses a single-value model is obtained when you use SQL statements to query time series data in Tablestore. Format: <Data point name column>#:#<Value column>. Example: "_field_name#:#_double_value".

    image

  5. Click Save dashboard in the upper-right corner. In the panel that appears, set the dashboard name and folder, and click Save.

Grafana V10.0.x

  1. On the Grafana homepage, click the image icon.

  2. In the left-side navigation pane, click Dashboards. On the page that appears, select New dashboard from the New drop-down list.

  3. On the New dashboard page, click + Add visualization.

  4. On the left side of the Select data source dialog box, select the data source that you added in Step 2.

  5. Configure the parameters in the following table and click Run SQL.

    Parameter

    Description

    Query

    The SQL statement. For more information, see SQL query.

    Example:

    SELECT
      *
    FROM
      your_table
    WHERE
      $__unixMicroTimeRangeFilter(_time)
      AND _m_name = "your_measurement"
      AND tag_value_at(_tags, "your_tag")="your_tag_value"
    LIMIT 1000
    Note
    • In the WHERE clause, the time range condition that is used to filter data is specified by using a predefined macro. In this example, the predefined macro is $__unixMicroTimeRangeFilter. For more information, see Use SQL to query time series data.

    • If you want data to be displayed in a time series chart, a time column that uses timestamps must be returned. You must specify the name of the time column.

    Format As

    The format of the results. Valid values:

    • Timeseries: displays the query results in a regular time series chart.

    • FlowGraph: displays the query results in a multi-dimensional chart.

    • Table: displays the query results in a regular table.

    Time Column

    The name of the time column in the query results that are returned. The time column is used as the x-axis of the time series chart.

    Aggregation Column

    This parameter is required if the Format As parameter is set to FlowGraph. This parameter is used to convert data in multiple rows of a single column at a specific point in time into data in multiple columns of a single row at the specified point in time. This parameter is suitable for converting data that uses a single-value model into data that uses a multi-value model. Data that uses a single-value model is obtained when you use SQL statements to query time series data in Tablestore. Format: <Data point name column>#:#<Value column>. Example: "_field_name#:#_double_value".

    image

  6. Click Apply.

  7. In the upper-right corner, click the 保存监控大盘 icon. Then, specify the name of the dashboard and the directory in which the dashboard resides.

Grafana V9.0.x

  1. In the left-side navigation pane of Grafana, choose image > New dashboard.

  2. On the New dashboard page, click Add a new panel.

  3. On the Query tab of the Edit Panel page, select the data source that you added in Step 2 from the Data source drop-down list.

  4. Configure the parameters in the following table and click Run SQL.

    Parameter

    Description

    Query

    The SQL statement. For more information, see SQL query.

    Example:

    SELECT
      *
    FROM
      your_table
    WHERE
      $__unixMicroTimeRangeFilter(_time)
      AND _m_name = "your_measurement"
      AND tag_value_at(_tags, "your_tag")="your_tag_value"
    LIMIT 1000
    Note
    • In the WHERE clause, the time range condition that is used to filter data is specified by using a predefined macro. In this example, the predefined macro is $__unixMicroTimeRangeFilter. For more information, see Use SQL to query time series data.

    • If you want data to be displayed in a time series chart, a time column that uses timestamps must be returned. You must specify the name of the time column.

    Format As

    The format of the results. Valid values:

    • Timeseries: displays the query results in a regular time series chart.

    • FlowGraph: displays the query results in a multi-dimensional chart.

    • Table: displays the query results in a regular table.

    Time Column

    The name of the time column in the query results that are returned. The time column is used as the x-axis of the time series chart.

    Aggregation Column

    This parameter is required if the Format As parameter is set to FlowGraph. This parameter is used to convert data in multiple rows of a single column at a specific point in time into data in multiple columns of a single row at the specified point in time. This parameter is suitable for converting data that uses a single-value model into data that uses a multi-value model. Data that uses a single-value model is obtained when you use SQL statements to query time series data in Tablestore. Format: <Data point name column>#:#<Value column>. Example: "_field_name#:#_double_value".

    image

  5. Click Apply.

  6. In the upper-right corner, click the 保存监控大盘 icon. Then, specify the name of the dashboard and the directory in which the dashboard resides.

  7. Click Save.

Step 4: View the monitoring data

Grafana V11.x

In the left-side navigation pane, click Dashboards. On the page that appears, click the dashboard in the target folder to view all monitoring charts.

Grafana V10.0.x

  1. In the upper-left corner of the Grafana homepage, click the image icon.

  2. In the left-side navigation pane, click Dashboards. On the Dashboards page, click the folder in which the dashboard you want to view is stored, and click the dashboard. On the page that appears, view all monitoring charts on the dashboard.

Grafana V9.0.x

  1. In the left-side navigation pane, move the pointer over the image icon and select Browse.

  2. On the Browse tab, click the folder in which the dashboard you want to view is stored, and click the dashboard. On the page that appears, view all monitoring charts on the dashboard.