Tencent Cloud CLS Assistant
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @tencent-adm/tencentcloud-cls.
About this skill
Problem
When debugging Tencent Cloud CLS, the issue is rarely just missing logs. It may be a wrong topic ID, an unrebuilt index, an offline machine, a collection rule not bound to the right machine group, an alarm shield, or a bad PromQL query. Manual API calls are easy to get wrong: SearchLog uses millisecond timestamps while QueryRangeMetric uses second-level timestamps, and SQL analysis cannot rely on Limit or Offset. This skill turns those checks into an API workflow around scripts/cls_api.py.
How It Works
- Log path: use
DescribeTopicsto find the topic,SearchLogfor CQL/SQL search,DescribeLogContextfor surrounding logs, andDescribeLogHistogramfor time distribution. - Collection path: use
DescribeMachineGroups,DescribeMachines,DescribeConfigs, andDescribeConfigMachineGroupsto verify machines, collection rules, and bindings. - Metrics and alarms: use
QueryRangeMetricfor PromQL, andDescribeAlarms,DescribeAlertRecordHistory,GetAlarmLog, andDescribeAlarmShieldsto trace missing or false alarms.
Boundaries
- Credentials must come from environment variables; do not embed
TENCENTCLOUD_SECRET_IDorTENCENTCLOUD_SECRET_KEYin commands. - Time precision varies: most log APIs use milliseconds, most metric APIs use seconds, and
DescribeLogContext.BTimeusesYYYY-mm-dd HH:MM:SS.FFF. DescribeLogContexthas regional limitations; in unsupported regions, simulate context withSearchLogover a time range.
Use Cases
- When production errors appear, search a CLS topic by time range with CQL and aggregate error codes.
- When log collection is missing, check machine groups, machine status, collection rules, and bindings.
- When an alarm did not fire, inspect policies, history, execution logs, and shield rules to find the gap.
- When checking host or cluster metrics, run PromQL range queries and verify topic, labels, and configs.
Best For
- SREs handling production incidents: search logs with CQL/SQL and inspect context and trends.
- Ops engineers maintaining log collection: verify machine groups, machine status, rules, and bindings.
- Platform engineers managing alerts: trace policies, history, execution details, and shields.
- Backend engineers using CLS metrics: query PromQL and verify labels and collection configs.
Related Skills
A lightweight wrapper and automation tool for Jaeger-related GitHub scenarios.
Vault Wrap is a wrapping skill for Vault and GitHub automation.
Port management, threat-intel audits, drift checks, and multi-node monitoring for self-hosted infrastructure.
Provides health checks for HTTP, TCP, Ping, and log sources with dynamic-threshold alerts, anomaly detection, and scheduled inspection reports.