All Products
Search
Document Center

Simple Log Service:Connect time series data to Grafana

Last Updated:Jun 03, 2026

MetricStore provides Prometheus-compatible query APIs. Add MetricStore as a Prometheus data source in Grafana to visualize time series data.

Prerequisites

Connect to Grafana

  1. Log on to Grafana.

  2. In the left-side navigation pane, choose Configuration > Data Sources.

  3. On the Data Sources tab, click Add data source.

  4. On the Prometheus card, click Select.

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

    Parameter

    Description

    Name

    Custom name for the data source. Example: Prometheus-01.

    HTTP

    • URL: MetricStore URL. Format: https://{project}.{sls-endpoint}/prometheus/{project}/{metricstore}. {sls-endpoint}: the endpoint for your Project's region. Service Endpoints. {project} and {metricstore}: your Project and MetricStore names. Example: https://sls-prometheus-test.cn-hangzhou.log.aliyuncs.com/prometheus/sls-prometheus-test/prometheus.

      Note

      Use https for secure data transmission.

    • Whitelisted Cookies: Optional. Cookies to add to the whitelist.

    Auth

    Enable the Basic auth toggle.

    Basic Auth Details

    • User: Your Alibaba Cloud account's AccessKey ID.

    • Password: Your Alibaba Cloud account's AccessKey secret.

    We recommend that you use a RAM user with read-only permissions on the Project. Read-only policy for a specified Project.

  6. Click Save & Test.

Import a dashboard

Log Service provides prebuilt dashboards in the Grafana marketplace.

  1. Copy the dashboard ID.

    1. Go to the Grafana Dashboards marketplace.

    2. Click the dashboard that you want to import.

    3. On the right side of the page, click Copy ID to Clipboard.

  2. Log on to Grafana.

  3. In the left-side navigation pane, choose Create > Import.

  4. In the Grafana.com Dashboard field, paste the dashboard ID that you copied in Step 1.

    After you paste the ID, click outside the field to load the import options.

  5. Configure the data source.

    Select the data source from the Connect to Grafana section. Some dashboards may require additional variables such as telegraf or host.

  6. Click Import.

Prometheus query APIs

Log Service supports the following Prometheus-compatible query APIs. Use them through the Grafana data source or call them directly.

API name

Example

Instant queries

GET /api/v1/query
POST /api/v1/query

Range queries

GET /api/v1/query_range
POST /api/v1/query_range

Getting label names

GET /api/v1/labels
POST /api/v1/labels

Querying label values

GET /api/v1/label/<label_name>/values

Finding series by label matchers

GET /api/v1/series
POST /api/v1/series