All Products
Search
Document Center

Simple Log Service:Collect Prometheus metrics with a Logtail plugin

Last Updated:Jun 03, 2026

Collect Prometheus-format metrics from Node Exporter, Kafka Exporter, and application endpoints using the Logtail plugin.

Prerequisites

You have created a Project and a MetricStore. For more information, see Manage a Project and Create a MetricStore.

Limitations

Logtail 0.16.66 or later on Linux is required. Upgrade earlier versions from Install Logtail (Linux system).

Procedure

Important

Each Logtail plugin supports only one Prometheus scrape configuration. If you define multiple, Logtail applies one at random.

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, on the Monitoring Data tab, click Prometheus Metric Scrape.

  3. Select the destination project and Metricstore, and then click Next.image

  4. On the Create Machine Group tab:

    • If a machine group is available, click Use Existing Machine Groups.image

    • If no machine groups are available, perform the following steps to create a machine group. In this example, an Elastic Compute Service (ECS) instance is used.

      1. On the ECS Instance tab, under Manually Select Instances, select the target ECS instance, and then click Create.

        For more information, see Install Logtail on ECS instances.

        Important

        If you want to collect logs from an ECS instance that belongs to a different Alibaba Cloud account than Simple Log Service, a server in a data center, or a server of a third-party cloud service provider, you must manually install Logtail. For more information, see Install Logtail on a Linux server. After you manually install Logtail, you must configure a user identifier for the server. For more information, see Configure a user identifier.

      2. After Logtail is installed, click Complete Installation.

      3. On the Create Machine Group page, enter a Name and click Next.

        You can use Simple Log Service to create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create a machine group.

  5. Confirm that the machine group is displayed in the Applied Server Groups section and click Next.

    Important

    If you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?

  6. In the Configure Data Source wizard, set Configuration Name and Plug-in Configuration, and then click Next.

    The Plug-in Configuration includes inputs and processors. Log Service provides an inputs template with global and scrape_configs nodes.

    • inputs is required and specifies the data source.

      Important
      • The scrape configuration follows native Prometheus rules. Only global and scrape_configs are supported. Prometheus scrape configuration rules.

      • Only one data source type is allowed per inputs block.

    • processors is optional and specifies processing rules. Append fields.

      To append the Logtail host IP, hostname, or custom fields to collected data, enable Use Advanced Edit Mode and add a processors configuration that uses the field appender processor. For example:

      {
        "processors":[
          {
            "type":"processor_appender",
            "detail": {
              "Key": "__labels__",
              "Value": "|host#$#{{__host__}}|ip#$#{{__ip__}}",
              "SortLabels": true
            }
          }
        ]
      }

Next steps