All Products
Search
Document Center

Simple Log Service:Ingest Prometheus metrics by using Remote Write

Last Updated:Jun 16, 2026

Send Prometheus monitoring data to Simple Log Service for analysis and monitoring.

Prerequisites

  • You have created a metricstore. For more information, see Create a metricstore.

  • You have installed Prometheus. For more information, see GETTING STARTED.

  • You have configured data scraping rules in Prometheus. For more information, see scrape_config.

Procedure

Simple Log Service supports the Prometheus Remote Write protocol. To send metrics, enable Remote Write in your Prometheus configuration.

  1. Log on to the server where Prometheus is deployed.

  2. Open the Prometheus configuration file and configure the remote_write section with the following parameters. Replace the example values with your actual information. For more information, see remote_write.

    url: https://sls-prometheus-test.cn-beijing.log.aliyuncs.com/prometheus/sls-prometheus-test/prometheus-raw/api/v1/write
    basic_auth:
      username: access-key-id
      password: access-key-secret
    queue_config:
      batch_send_deadline: 20s
      capacity: 20480
      max_backoff: 5s
      max_samples_per_send: 2048
      min_backoff: 100ms
      min_shards: 100                      

    Parameter

    Description

    url

    The URL of the metricstore in Simple Log Service. The URL has the following format: https://{project}.{sls-endpoint}/prometheus/{project}/{metricstore}/api/v1/write.

    • {sls-endpoint}: The service endpoint. For more information, see Endpoints.

    • {project}: The project name.

    • {metricstore}: The metricstore name.

    Important
    • If your Prometheus instance runs on the Alibaba Cloud internal network, use an internal network endpoint.

    • To ensure secure data transmission, you must use an HTTPS endpoint.

    basic_auth

    The authentication credentials. Basic authentication is required to write data to Simple Log Service by using Remote Write.

    • username: The AccessKey ID of your Alibaba Cloud account.

    • password: The AccessKey secret of your Alibaba Cloud account.

    For security, use the AccessKey pair of a RAM user with write-only permissions for the project. For more information, see Grant write permissions on a specific project.

    queue_config

    queue_config configures write policies such as caching and retries.

    To avoid excessive invalid network requests, set min_backoff to at least 100 ms and max_backoff to at least 5s.

    If you send a large volume of data from Prometheus, use the following queue_config settings:

    batch_send_deadline: 20s
    capacity: 20480
    max_backoff: 5s
    max_samples_per_send: 2048
    min_backoff: 100ms
    min_shards: 100
  3. Verify that data is being sent to Simple Log Service.

    After configuring Prometheus, preview the incoming data in the Simple Log Service console to verify the connection.

    1. Log on to the Simple Log Service console.

    2. In the Projects section, click the target project.

    3. In the left-side navigation pane, choose Time Series Storage > metricstore. On the metricstore tab, find your metricstore and choose 修改日志库 > Consumption Preview.

      On the Consumption Preview page, if data appears, the configuration is successful. The data is displayed in a table with Time/Source and Content columns. Each entry contains Prometheus metric information, including the metric name (__name__), labels (__labels__), and value (__value__).

      Important

      If time-series data is written to an SLS metricstore by using the remote write protocol, SLS uses MetricName and Labels as the default HashKey. This routes time-series data from different timelines into specific shards to improve data locality on the storage side.

What to do next

After Prometheus monitoring data is ingested into Simple Log Service, you can: