All Products
Search
Document Center

Application Real-Time Monitoring Service:Monitor Tencent Cloud resources with Managed Service for Prometheus

Last Updated:Mar 11, 2026

Deploy the QCloud exporter on a Container Service for Kubernetes (ACK) cluster to collect Tencent Cloud metrics in Managed Service for Prometheus. This gives you cross-cloud visibility from a single monitoring platform.

How it works

The QCloud exporter is a third-party Prometheus exporter that queries the Tencent Cloud CM API and exposes metrics at a /metrics endpoint. After you deploy the exporter as a pod in your ACK cluster, a ServiceMonitor tells Managed Service for Prometheus to scrape that endpoint at a regular interval.

The overall workflow:

  1. Build and deploy the QCloud exporter in your ACK cluster.

  2. Create a ServiceMonitor so that Managed Service for Prometheus discovers and scrapes the exporter.

  3. Configure alert rules on the collected metrics.

Workflow diagram

Supported Tencent Cloud services

The QCloud exporter supports the following Tencent Cloud services. Each row links to the corresponding CM metric reference.

ServiceNamespaceMetrics
TencentDB for MongoDBQCE/CMONGOMetric details
Cloud DatabaseQCE/CDBMetric details
TencentDB for Redis (standard architecture)QCE/REDISN/A
TencentDB for Redis (cluster architecture)QCE/REDIS_CLUSTERN/A
TencentDB for Redis (Memory Edition)QCE/REDIS_MEMMetric details
Cloud Virtual Machine (CVM)QCE/CVMMetric details
Cloud Object Storage (COS)QCE/COSMetric details
Content Delivery Network (CDN)QCE/CDNMetric details
Cloud Load Balancer (Internet)QCE/LB_PUBLICMetric details
Cloud Load Balancer (Layer 7)QCE/LOADBALANCEMetric details
NAT GatewayQCE/NAT_GATEWAYMetric details
Direct Connect (connection)QCE/DCMetric details
Direct Connect (dedicated tunnel)QCE/DCXMetric details
Cloud Block Storage (CBS)QCE/CBSMetric details
TencentDB for SQL ServerQCE/SQLSERVERMetric details
TencentDB for MariaDBQCE/MARIADBMetric details
Elasticsearch Service (CES)QCE/CESMetric details
Cloud Message Queue (queue service)QCE/CMQMetric details
Cloud Message Queue (topic subscription)QCE/CMQTOPICMetric details
TencentDB for PostgreSQLQCE/POSTGRESMetric details
CKafkaQCE/CKAFKAMetric details
MemcachedQCE/MEMCACHEDN/A
LighthouseQCE/LIGHTHOUSEN/A
TDSQL for MySQLQCE/TDMYSQLMetric details
Elastic IPQCE/LBMetric details

Prerequisites

Before you begin, make sure that you have:

Step 1: Deploy the QCloud exporter

Build the exporter image

Clone the repository and build the binary:

git clone https://github.com/tencentyun/tencentcloud-exporter.git
make build

Configure the exporter

Create a configuration file (for example, qcloud.yaml) that specifies your Tencent Cloud credentials and the services to monitor.

The following example exports all CVM metrics for every instance in the ap-nanjing region:

credential:
  access_key: "access_key"    # The SecretId of TencentCloud API
  secret_key: "secret_key"    # The SecretKey of TencentCloud API
  region: "ap-nanjing"        # The region where the instances reside

rate_limit: 15  # The maximum number of API calls that CM can make per second to pull data. Example: 20. For more information, see https://cloud.tencent.com/document/product/248/31014

products:
  - namespace: QCE/CVM  # CVM metrics. See https://cloud.tencent.com/document/product/248/6843
    all_metrics: true    # Export all supported metrics
    all_instances: true  # Export metrics from every instance in the specified region
    extra_labels: [InstanceId, InstanceName]
    # Optional filters - uncomment and edit as needed:
    # only_include_metrics: []
    # only_include_instances: [ins-xxxxxxxx]
    # statistics_types: [last]
    # period_seconds: 60
    # metric_name_type: 2

For the full list of configuration options, see the tencentcloud-exporter README.

Create a Deployment

Package the exporter and its configuration file into a Docker image, then push the image to a container registry such as DockerHub or Container Registry.

Deploy the exporter to your ACK cluster:

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

  2. On the Clusters page, find your cluster and click Applications in the Actions column.

  3. In the left-side navigation pane, choose Workloads > Deployments.

  4. On the Deployments page, click Create from YAML.

  5. On the Create page, enter the following YAML in the Template code 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

Create a Service

Expose the exporter so that Prometheus can scrape it:

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

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

  3. On the Create page, enter the following YAML in the Template code 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: Add a service discovery configuration

Configure a ServiceMonitor so that Managed Service for Prometheus discovers and scrapes the QCloud exporter.

Important

The ACK cluster must already be connected to Managed Service for Prometheus. For more information, see .

  1. Log on to the ARMS console.

  2. In the left-side navigation pane, choose Managed Service for Prometheus > Instances.

  3. In the top navigation bar, select the region where the ACK cluster resides, and click the name of the cluster.

  4. In the left-side navigation pane, click Service Discovery. Then, click the Configure tab.

  5. On the Configure tab, click the ServiceMonitor tab, and then click Add ServiceMonitor.

  6. In the Add ServiceMonitor dialog box, enter the following YAML 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

After you save the configuration, the new ServiceMonitor appears on the ServiceMonitor tab.

ServiceMonitor tab

Step 3: Create an alert rule

After metrics are collected, set up alerts based on them. For instructions, see Create an alert rule for a Prometheus instance.