All Products
Search
Document Center

Managed Service for Prometheus:Monitor Tencent Cloud resources with Prometheus

Last Updated:Jun 16, 2026

You can use Managed Service for Prometheus to monitor Tencent Cloud resources by deploying the open-source QCloud exporter.

Prerequisites

Background information

The open-source QCloud exporter converts Tencent Cloud Monitor metrics into the Prometheus format. Prometheus scrapes these metrics from the exporter to monitor Tencent Cloud resources.

Tencent Cloud Cloud Monitor (CM) provides unified real-time monitoring and alerts for Tencent Cloud resources such as cloud servers and cloud databases. The QCloud exporter is a Prometheus third-party exporter. The following table lists the supported Tencent Cloud resources.

Product

Namespace

Supported metrics

TencentDB for MongoDB

QCE/CMONGO

Metric details

Cloud Database (CDB)

QCE/CDB

Metric details

TencentDB for Redis (Standard Edition)

QCE/REDIS

Metric details are not available.

TencentDB for Redis (Cluster Edition)

QCE/REDIS_CLUSTER

Metric details are not available.

TencentDB for Redis (Memory Edition)

QCE/REDIS_MEM

Metric details

cloud server

QCE/CVM

Metric details

Cloud Object Storage (COS)

QCE/COS

Metric details

Content Delivery Network (CDN)

QCE/CDN

Metric details

Cloud Load Balancer (public network)

QCE/LB_PUBLIC

Metric details

Cloud Load Balancer (Layer-7)

QCE/LOADBALANCE

Metric details

NAT Gateway

QCE/NAT_GATEWAY

Metric details

Direct Connect

QCE/DC

Metric details

Direct Connect Tunnel

QCE/DCX

Metric details

cloud disk

QCE/CBS

Metric details

TencentDB for SQL Server

QCE/SQLSERVER

Metric details

TencentDB for MariaDB

QCE/MARIADB

Metric details

Elasticsearch Service

QCE/CES

Metric details

Cloud Message Queue (CMQ) Queue Service

QCE/CMQ

Metric details

CMQ Topic Subscription

QCE/CMQTOPIC

Metric details

TencentDB for PostgreSQL

QCE/POSTGRES

Metric details

CKafka instance

QCE/CKAFKA

Metric details

Memcached

QCE/MEMCACHED

Metric details are not available.

Lighthouse

QCE/LIGHTHOUSE

Metric details are not available.

TDSQL for MySQL

QCE/TDMYSQL

Metric details

Elastic IP Address (EIP)

QCE/LB

Metric details

Procedure

The following diagram shows the workflow for monitoring Tencent Cloud resources with Managed Service for Prometheus.

Step 1: Deploy the QCloud exporter

  1. Build the image.

    git clone https://github.com/tencentyun/tencentcloud-exporter.git
    make build
  2. Define the product instance configuration.

    • Configure credential information for the cloud API.

    • Configure the products, metrics, and instances to export.

    For example, to export all metrics and instances for a cloud server, use the following configuration.

    credential:
      access_key: "access_key"  # The SecretId of the cloud API.
      secret_key: "secret_key"  # The SecretKey of the cloud API.
      region: "ap-nanjing"      # The region where the instance is located.
    
    rate_limit: 15              # The rate limit for pulling data from Cloud Monitor. The maximum is 20 calls/second or 1,200 calls/minute. For more information, see https://cloud.tencent.com/document/product/248/31014.
    
    products:
      - namespace: QCE/CVM      # For metric details, see https://cloud.tencent.com/document/product/248/6843.
        all_metrics: true       # Export all supported metrics.
        all_instances: true     # Export all instances in the region.
        #only_include_metrics: []
        #only_include_instances: [ins-xxxxxxxx]
        extra_labels: [InstanceId, InstanceName] # Export instance fields as metric labels.
        #statistics_types: [last]
        #period_seconds: 60
        #metric_name_type: 2
    Note

    For more information about how to configure the qcloud.yaml file, see the tencentcloud-exporter documentation.

  3. Deploy the QCloud exporter.

    Build a Docker image with the configuration file and upload it to a repository, such as Docker Hub or Container Registry (ACR).

    1. Log on to the ACK console. In the left navigation pane, click Clusters.

    2. On the Clusters page, find the target cluster and click Applications in the Operation column.

    3. Create a Deployment.

      1. In the left-side navigation pane, choose Workload > Stateless.

      2. On the Stateless page, click Create Resources in YAML.

      3. On the Create page, enter the following YAML in the Template editor and click Create .

        apiVersion: apps/v1
        kind: Deployment
        metadata:
          generation: 5
          labels:
            app: qcloud-exporter-demo
          name: qcloud-exporter-demo
          namespace: default
        spec:
          replicas: 1
          selector:
            matchLabels:
              app: qcloud-exporter-demo
          template:
            metadata:
              labels:
                app: qcloud-exporter-demo
            spec:
              containers:
                - args:
                    - '--config.file=/usr/local/etc/qcloud-cvm-product.yml'
                  image: 'registry.cn-hangzhou.aliyuncs.com/fuling/qcloud-exporter:v0.1'
                  imagePullPolicy: Always
                  name: qcloud-exporter
                  ports:
                    - containerPort: 9123
                      name: web-normal
                      protocol: TCP
    4. Create a service.

      1. In the left-side navigation pane, choose Network > Service.

      2. On the Service page, click Create Resources in YAML.

      3. On the Create page, enter the following YAML in the Template editor and click Create .

        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: qcloud-exporter-demo
          name: qcloud-exporter-demo-svc
          namespace: default
        spec:
          ports:
            - name: qcloud-exporter-metrics
              port: 9123
              protocol: TCP
              targetPort: 9123
          selector:
            app: qcloud-exporter-demo

Step 2: Configure service discovery

Configure service discovery in Managed Service for Prometheus to scrape metrics from the QCloud exporter.

Important

Ensure that your ACK cluster is connected to Managed Service for Prometheus. For more information, see Prometheus instance for Container Service.

  1. Log on to the Managed Service for Prometheus console.

  2. In the navigation pane on the left, click Instances.

  3. In the top menu bar, select the region of your ACK cluster, and then click the target instance name.

  4. In the left-side navigation pane, click Service Discovery, and then click the Configurations tab.

  5. On the Configurations page, click the ServiceMonitor tab, then click Add ServiceMonitor, and in the Add ServiceMonitor dialog box, enter the following content and click OK.

    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: qcloud-exporter-sm
      namespace: default
    spec:
      endpoints:
      - interval: 60s
        path: /metrics
        port: qcloud-exporter-metrics
        scrapeTimeout: 60s
      namespaceSelector:
        any: true
      selector:
        matchLabels:
          app: qcloud-exporter-demo

    The new service discovery configuration appears on the ServiceMonitor page.

    image

Step 3: Create an alert rule

Create a Prometheus alert rule. For instructions, see Create a Prometheus alert rule.