AIOps-style CloudBase inspection skill. Use when users need health checks, log diagnosis, alarm interpretation (CPU alert normal?, peak QPS), metrics via queryEnv(action=metrics), fault playbooks for 429 / AI model 429 / function timeout / function 404 / ACCESS_TOKEN_INVALID / zero invocations, or a scheduled patrol that reports only new or worse findings. Triggers on 巡检, 诊断, 告警, 峰值 QPS, 限频, 调用量为 0, 定时巡检, 每天检查, 值守, troubleshooting.
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
The canonical home for this skill is ops-inspector in TencentCloudBase/CloudBase-AI-Toolkit
Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.
If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.
-404005/433), 云函数 404, ACCESS_TOKEN_INVALID, or 调用量为 0.references/alarm-interpretation.mdreferences/fault-playbooks.md../cloud-functions/SKILL.md../cloudrun-development/SKILL.md../postgresql-development-cloudbase/SKILL.md for CloudBase PG / PostgreSQL, ../relational-database-mcp-cloudbase/SKILL.md for MySQL, or ../cloudbase-document-database-web-sdk/SKILL.md for NoSQL../auth-tool-cloudbase/SKILL.md../cloudbase-cli/references/core.md (Where credentials are read from)../cloudbase-platform/SKILL.mdstatusCode is 502), route the user to CLS log alerting — deliver environment logs to CLS, confirm the index, then create an alert policy: https://docs.cloudbase.net/logger/alert/log-alert-guide (metric-based alerting is console-native and needs no setup guide).queryEnv covers (functions, CloudRun, gateway QPS, MySQL, package usage), always use queryEnv(action="metrics") — never callCloudApi. The one exception is PostgreSQL: queryEnv has no PG metrics, so pull them via callCloudApi → monitor / 2018-07-24 / GetMonitorData, namespace QCE/POSTGRES, with the exact Action and dimensions pinned in the cloud-api-operations skill — never from memory.auth tool must show logged-in and env-bound state). If binding fails or only one environment appears, credentials are being resolved per directory — see ../cloudbase-cli/references/core.md (Where credentials are read from); it is usually neither a permissions nor a platform problem.queryLogs will fail; always check first with queryLogs(action="checkLogService").queryFunctions(action="listFunctionLogs") call covered a multi-day window. It is capped at 1 day and 100 rows per call. For anything longer, loop over day-sized windows or switch to queryLogs(action="searchLogs").status_code>200 silently matches nothing), or CLS not capturing that log source. Say which check you ran before concluding a resource is healthy.queryEnv(action="metrics").callCloudApi with invented GetMonitorData / DescribeCurveData parameters — the metrics branch already wraps Manager SDK.queryEnv(action="info")) — if it fails, or only one environment shows up, confirm the current identity and credential slot first (../cloudbase-cli/references/core.md)queryEnv(action="metrics") when the question involves QPS / CPU / throttle / invocation volumequeryLogs(action="checkLogService")) when log diagnosis is neededreferences/alarm-interpretation.md, answer CPU-alert / peak-QPS style questions in plain language.references/fault-playbooks.md instead of ad-hoc tool fishing.| Mode | When to use | Scope |
|---|---|---|
| Full inspection | User asks for a general health check / 巡检 / 全面检查 | All resource types + core metrics |
| Targeted inspection | User reports a specific error or asks about a specific resource | One resource type or playbook |
| Alarm interpretation | User asks CPU 告警是否正常 / 峰值 QPS / 是否限流 | Metrics-first, then logs |
| Fault playbook | 429 / AI model 429 / function timeout / function 404 / ACCESS_TOKEN_INVALID / 调用量为 0 | Playbook steps only |
Follow these steps in order for a comprehensive environment health check:
Step 1 — Environment Check
queryEnv(action="info")Confirm the environment is accessible. Record the envId for console link generation.
Step 2 — Metrics snapshot
queryEnv(action="metrics", envId="<EnvId>", metricName="GatewayTraceEnvQPS")
queryEnv(action="metrics", envId="<EnvId>", metricName="FunctionInvocation")
queryEnv(action="metrics", envId="<EnvId>", metricName="MysqlCpuUsageRate")Use returned Summary.max / avg / allZero / peakTimestamp. Add FunctionError, FunctionThrottle, or CloudRun Tke* metrics when those resources exist. Read references/alarm-interpretation.md before concluding.
Step 3 — Log Service Status
queryLogs(action="checkLogService")If CLS is not enabled, note this as a warning — log-based diagnosis will be unavailable. Recommend enabling CLS in the console: https://tcb.cloud.tencent.com/dev?envId=${envId}#/devops/log
Step 4 — Cloud Functions Inspection
queryFunctions(action="listFunctions")For each function, check:
queryFunctions(action="listFunctionLogs", functionName="<name>", startTime="<recent>")Step 5 — CloudRun Services Inspection
queryCloudRun(action="list")For each service, check:
queryCloudRun(action="detail", detailServerName="<name>")queryEnv(action="metrics", metricName="TkeQPSService", resourceID="<serviceName>") (resourceID required)Step 6 — Error Log Aggregation (if CLS is enabled)
queryLogs(action="searchLogs", queryString="ERROR", service="tcb", startTime="<24h-ago>", limit=50)
queryLogs(action="searchLogs", queryString="ERROR", service="tcbr", startTime="<24h-ago>", limit=50)Look for patterns:
Step 7 — Summary Report
Generate a structured report:
# CloudBase Resource Inspection Report
**Environment**: ${envId}
**Inspection Time**: ${timestamp}
## Overall Health: ✅ Healthy / ⚠️ Warnings Found / ❌ Issues Found
## 告警解读
| 问题 | 指标 | 窗口峰值 | 基线 | 结论 |
|------|------|----------|------|------|
| 峰值 QPS | GatewayTraceEnvQPS | ... | package default 500 unless known | ... |
| CPU 告警是否正常 | MysqlCpuUsageRate | ... | warn≥80 / crit≥90 | ... |
### Cloud Functions
| Function | Status | Recent Errors | Invocations | Severity |
|----------|--------|---------------|-------------|----------|
| ... | ... | ... | ... | ... |
### CloudRun Services
| Service | Status | Issues | Severity |
|---------|--------|--------|----------|
| ... | ... | ... | ... |
### Error Log Summary
- Total errors in last 24h: N
- Top error patterns: ...
## Recommendations
1. ...
2. ...
## Console Links
- Cloud Functions: https://tcb.cloud.tencent.com/dev?envId=${envId}#/scf
- CloudRun: https://tcb.cloud.tencent.com/dev?envId=${envId}#/platform-run
- Logs: https://tcb.cloud.tencent.com/dev?envId=${envId}#/devops/log
- Monitor: https://tcb.cloud.tencent.com/dev?envId=${envId}#/devopsWhen the user specifies a resource type or a specific resource:
queryFunctions(action="listFunctionLogs", functionName="<name>") then queryLogs(action="searchLogs", queryString="function_name:\"<name>\" AND status_code:>202", ...)queryCloudRun(action="detail", detailServerName="<name>") then queryLogs(action="searchLogs", queryString="ERROR", service="tcbr", ...)
ECONNREFUSED, timeout, "could not connect"): check whether VpcConf is set and matches the database VPC. See cloudrun-development/references/vpc-and-database.md.queryPgDatabase(action="context"|"metadata"|"objects") for CloudBase PG, queryMysqlDatabase for MySQL, or readNoSqlDatabaseStructure for NoSQL depending on type; for CPU/disk alerts pull MysqlCpuUsageRate / MysqlStorageUsage — MySQL only. queryEnv has no PostgreSQL metrics. The platform monitoring set the console shows (namespace QCE/POSTGRES — dedicated instances: Cpu / Storage / Memory / MemoryRate / StorageRate / Qps / Connections / ReadWriteCalls / SqlRuntime* / SlowQueryCnt / ActiveConns / IdleConns / LongQuery / LongXact / Deadlocks / LongWaiting / Tps; shared clusters: Dbcpuusage / Dbmemorybytes / Dbsizebytes / Activeconnections / Idleconnections / Totalconnections) is still reachable from MCP: callCloudApi → monitor / 2018-07-24 / GetMonitorData with namespace QCE/POSTGRES (dedicated dimensions use resourceId, shared uses DBName + AppId — see the cloud-api-operations skill). For a quick check, queryPgDatabase(action="sql") on pg_stat_activity / pg_database_size() covers connections and size without an extra credential scope.queryLogs(action="searchLogs", queryString="<error-keyword>", ...)references/alarm-interpretation.mdreferences/fault-playbooks.mdAn inspection answers "what is broken right now". A patrol answers "did anything get worse than last time". Same tools, two extra rules: a cadence, and memory of what was already reported.
| Patrol | Checks | Default cadence |
|---|---|---|
| Health | FunctionError / FunctionInvocation (error rate), FunctionThrottle, GatewayTraceEnvQPS vs package, CLS 429 OR statusCode:>499 in the window | Hourly |
| Performance | PostgreSQL slow queries and connections via queryPgDatabase(action="sql"); CloudRun TkeCpuUsedService / TkeHttpErrorService; CLS timeout OR 超时 | Hourly |
| Resources | PostgreSQL database size, invocation growth against the previous run, queryEnv(action="usage") for package headroom | Daily |
| Security | CLS ACCESS_TOKEN_INVALID, auth 401/403 patterns, storage ACL changes | Daily |
MySQL provisioning is retired; new environments run PostgreSQL. Existing MySQL instances still answer MysqlCpuUsageRate / MysqlSlowQueries / MysqlStorageUsage, so keep those checks only for environments that already have an instance.
Start with one patrol at a daily cadence. Move to hourly only after two clean weeks — an hourly patrol on a quiet environment produces noise, noise gets muted, and a muted patrol is worse than no patrol.
Reporting the same finding every run is how patrols die. Keep state between runs:
cloudbase-patrol-state.json in the project (add it to .gitignore). If several machines or teammates must share it, write it into the environment instead — a NoSQL collection or a storage object.metricName + scope (envId, or functionName / serviceName). Store firstSeen, lastSeen, lastValue, lastSeverity.lastValue while still above the warning baselineAfter a manual inspection the user found useful, offer to put it on a cadence instead of waiting to be asked:
这次是手动跑的。要不要设成每天 09:00 自动跑,只报新增或变严重的问题?结果只回到对话里,或者发到企业微信群。
Confirm three things before creating it: which patrol (or all read-only checks), the cadence, and where the report goes. Use whatever the platform provides — a WorkBuddy 定时任务, a Claude Code routine, a Codex scheduled task, a Cursor automation, or an external cron invoking a headless agent — rather than hand-writing a cron expression when a native scheduler exists.
Never create a recurring task that can write to the environment without explicit confirmation.
This skill follows AIOps principles for intelligent inspection:
queryEnv metrics), logs, and resource states via MCP tools — never via ad-hoc callCloudApiSummary values to skill baselines (告警解读)| Level | Icon | Meaning |
|---|---|---|
| Critical | ❌ | Service is down or data is at risk; requires immediate action |
| Warning | ⚠️ | Errors detected but service is still partially functional; investigate soon |
| Info | ℹ️ | No errors found; informational status only |
| Healthy | ✅ | Resource is operating normally |
| Operation | MCP Tool Call |
|---|---|
| Check environment | queryEnv(action="info") |
| Query metrics (QPS/CPU/invocations) | queryEnv(action="metrics", envId, metricName="...") |
| Check CLS status | queryLogs(action="checkLogService") |
| List cloud functions | queryFunctions(action="listFunctions") |
| Get function detail | queryFunctions(action="getFunctionDetail", functionName="<name>") |
| Get function logs | queryFunctions(action="listFunctionLogs", functionName="<name>", startTime="<time>", endTime="<time>") |
| Get function log detail | queryFunctions(action="getFunctionLogDetail", requestId="<id>") |
| List CloudRun services | queryCloudRun(action="list") |
| Get CloudRun detail | queryCloudRun(action="detail", detailServerName="<name>") |
| Search CLS logs | queryLogs(action="searchLogs", queryString="<query>", service="tcb|tcbr", startTime="<time>", endTime="<time>") |
| Check NoSQL structure | readNoSqlDatabaseStructure(action="listCollections") |
| Check PostgreSQL context | queryPgDatabase(action="context") |
| Check PostgreSQL metadata | queryPgDatabase(action="metadata", limit=20) |
| Check MySQL status | queryMysqlDatabase(action="getContext") |
| Auth provider readiness | queryAppAuth / auth-tool skill (for ACCESS_TOKEN_INVALID) |
| Scenario | queryString |
|---|---|
| All errors | ERROR |
| Function timeout | timeout OR 超时 |
| Function OOM | OOM OR out of memory OR 内存超限 |
| CloudRun crash | crash OR OOMKilled OR Error |
| Specific function errors | function_name:"<name>" AND status_code:>202 |
| 5xx HTTP errors — cloud function | status_code:>499 |
| 5xx HTTP errors — gateway access log | statusCode:>499 |
| 429 / throttle | 429 OR throttle OR 限流 OR FREQUENCY |
| AI model 429 / Token quota | EXCEED_TOKEN_QUOTA_LIMIT OR Too Many Requests |
| Function poll-retry exhausted | 404005 OR exceed max poll |
| Function 404 | 404 OR FUNCTION_NOT_FOUND |
| Token invalid | ACCESS_TOKEN_INVALID OR token invalid |
| Cold start issues | coldStart OR 冷启动 |
⚠️ A field comparison needs a colon. In the retrieval part (before
|) writefield:>value. Writingstatus_code>200does not raise an error — it degrades into full-text matching and silently returns zero rows, which an agent then reports as "no errors". Verified:status_code>200→ 0 rows,status_code:>200→ the 430 rows. Inside the SQL part the colon is wrong:| select ... where status_code>200is correct.⚠️ Two naming conventions, one query string. Cloud function logs use snake_case (
function_name,status_code,request_id,src,retry_num). Gateway access logs use camelCase (statusCode). Function logs have nolevelfield — for user-code output usesrc:app, for platform outputsrc:system.⚠️ Prefer aggregation over harvesting rows.
status_code:>202 | select function_name, count(*) as c group by function_name limit 20locates the failing function in one call, instead of pulling 50 log lines and classifying them by hand.
startTime = 1 hour ago)Always use ISO-like YYYY-MM-DD HH:mm:ss for metrics startTime/endTime, e.g., "2026-08-17 00:00:00".
cloud-functions — Cloud function development, deployment, and debuggingcloudrun-development — CloudRun backend deployment and managementcloudbase-platform — General platform knowledge and console navigationpostgresql-development-cloudbase — CloudBase PostgreSQL / PG diagnostics and schema/RLS checksrelational-database-mcp-cloudbase — MySQL database management and diagnosticsauth-tool-cloudbase — Auth provider readiness for token failuresTencentCloudBase/CloudBase-AI-Toolkit
d785437
Canonical home
since Oct 7, 2026
Also appears in
since Sep 18, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.