You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
LogCollector collection
Collect metric topic data
Copy page
Download PDF
Collect metric topic data

LogCollector v2.3.2 and later versions support collecting metric data from servers based on collection configurations, and can collect various types of metric data in Prometheus format. This topic describes the steps for creating a metric collection configuration.

tip

Metric topic is now in closed beta. If you have business needs, contact your account manager for allowlist access.

Prerequisites

Steps

Step 1 Select a log space

  1. Log in to TLS console.
  2. Select the region where log service is located from the top navigation bar.
  3. On the left navigation bar, select Common functions > Log collection.
  4. On the log collection page, click Metric collection, then click Metric topic collection.
  5. Select the project and metric topic, then click Next: Select host group.
    The collected metric data will be stored in this metric topic.

Step 2 Select host group

  1. In the All host groups area, select the host group from which you want to collect metrics.
    If no host group is available in the list, you need to create a host group first. For detailed instructions, see Create host group (IP address) or Create host group (Host identification).
  2. After confirming the host group in the Selected host group section, click Next Step: Collection rule.

Step 3 Configure collection rule

  1. Enter the Rule name.

    • The length must be between 3 and 64 characters.
    • Can only contain Chinese, letters, numbers, underscores (_), and hyphens (-).
    • Cannot start or end with a hyphen (-).
  2. Enter the Plugin configuration.
    Enter the collection plugin configuration. For details, see the Prometheus official website. Example:

    global:
      scrape_interval: 30s # Default is every 30s.
      scrape_timeout: 10s  #is set to the global default (10s).
      # A scrape configuration containing exactly one endpoint to scrape:
      # Here it's Prometheus itself.
    scrape_configs:
      # The job name is added as a label 'job=<job_name>' to any timeseries scraped from this config.
      - job_name: 'prometheus'
        # metrics_path defaults to '/metrics'
        # metrics_path: '/metrics'
        # scheme defaults to 'http'.
        # scheme: 'http'
        static_configs:
        - targets: ['localhost:9090']
    
  3. Click Submit.

Next steps

After creating the collection configuration, LogCollector will collect metric data and save it to the specified metric topic. You can perform query and analysis operations in the metric topic. For details, see Query and analysis metric topics.

Last updated: 2025.12.26 10:51:13