Cloud Native 10 min read

Eliminate Complex Integration: AI Agent Skill Powers Cloud Monitoring

The article shows how Alibaba Cloud's CMS CLI and the AI‑driven alibabacloud‑cms‑manage Skill turn a multi‑step observability setup into a single natural‑language command, detailing the six‑step CLI workflow, the two‑stage confirmation safety, and a full K8s LangChain auto‑integration demo.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Eliminate Complex Integration: AI Agent Skill Powers Cloud Monitoring

Background

Enterprises adopting cloud‑native architectures and AI workloads must monitor a growing variety of applications—from Java micro‑services to AI agents and Go back‑ends. Traditional observability onboarding involves many parameters and steps, increasing operational overhead.

CMS CLI Overview

Alibaba Cloud CloudMonitor Service (CMS) 2.0 unifies APM, RUM, Prometheus and alerting. The CMS CLI ( aliyun cms2) provides sub‑commands for all modules, enabling terminal‑based observability integration.

# Verify CLI installation and version
$ aliyun version
3.3.20
# Check cms2 plugin availability
$ aliyun cms2 --help
# Configure credentials if needed
$ aliyun configure

Application Integration Capabilities

CMS CLI supports APM integration via three methods: ack‑onepilot (K8s containers), custom probes, and native OpenTelemetry. For AI observability, CMS 2.0 offers out‑of‑the‑box support for major AI frameworks.

CLI Integration Process (6 steps)

Regardless of language or integration method, the CLI follows a six‑step workflow.

CLI 6‑step flowchart
CLI 6‑step flowchart
# Step 1: Get account ID
$ aliyun sts get-caller-identity --force -o json
# → AccountId: 1108xxxxxxxxxxxx

# Step 2: Initialize APM (idempotent)
$ aliyun cms2 apm configuration create \
    --workspace default-cms-1108xxxxxxxxxxxx-cn-hangzhou \
    --region cn-hangzhou

# Step 3: Retrieve credentials
$ aliyun cms2 apm configuration get \
    --workspace default-cms-1108xxxxxxxxxxxx-cn-hangzhou \
    --region cn-hangzhou -o json

# Step 4: Register service
$ aliyun cms2 apm service create \
    --workspace default-cms-1108xxxxxxxxxxxx-cn-hangzhou \
    --region cn-hangzhou \
    --body '{"serviceName":"my-app","serviceType":"TRACE","attributes":"{\"language\":\"java\"}"}'

# Step 5: Get integration template (Java OTel example)
$ aliyun cms2 integration addon get --addon-name apm-java-batch --env-type Client -o json

# Step 6: Verify integration
$ aliyun cms2 apm service list \
    --workspace default-cms-1108xxxxxxxxxxxx-cn-hangzhou \
    --service-name my-app --region cn-hangzhou

Although the flow is explicit, the six‑step, multi‑parameter process can be daunting for occasional operators.

AI Agent Skill for Intelligent Integration

The alibabacloud‑cms‑manage Skill encapsulates the entire CLI workflow into a structured AI‑Agent executable. Users describe the desired integration in natural language; the Agent generates and runs the required CLI commands.

Skill coverage diagram
Skill coverage diagram

Security Mechanism: Two‑Stage Confirmation

Operations that may affect a cluster (e.g., component installation, Deployment patch) trigger a two‑stage confirmation. Read‑only commands ( get, list) and backend resource creation ( apm configuration create) execute automatically, while mutating commands require explicit user approval.

Two‑stage confirmation diagram
Two‑stage confirmation diagram

Demo: Automatic K8s LangChain Integration

Natural‑language request:

Help me integrate the LangChain app customer-support-agent in my ACK cluster with CMS monitoring.

The Agent performs:

Account ID retrieval

Cluster discovery (region derived automatically)

APM infrastructure creation and credential extraction

Service registration

Component status checks (ack‑onepilot)

Deployment lookup and patching with a confirmation prompt

Key commands executed by the Agent:

# Retrieve account ID
$ aliyun sts get-caller-identity --force -o json

# Describe clusters
$ aliyun cs describe-clusters

# Create APM configuration
$ aliyun cms2 apm configuration create ...

# Register service
$ aliyun cms2 apm service create ...

# Patch Deployment (after user confirms "yes")
$ kubectl patch deployment customer-support-agent -n default \
    --type=strategic -p '{"spec":{"template":{"metadata":{"labels":{"aliyun.com/app-language":"python","armsPilotAutoEnable":"on","armsPilotCreateAppName":"customer-support-agent","armsPilotAppWorkspace":"default-cms-1108..."}}}}}'

# Verify rollout
$ kubectl rollout status deployment/customer-support-agent -n default --timeout=120s

After the patch, the ack‑onepilot sidecar injects a Python probe automatically. Within minutes, monitoring data (LLM call latency, token usage, agent trace) appears in the CMS console.

K8s ack‑onepilot auto‑integration
K8s ack‑onepilot auto‑integration

Resources

Alibaba Cloud CLI: https://github.com/aliyun/aliyun-cli

alibabacloud‑cms‑manage Skill: https://skills.aliyun.com/skills/alibabacloud-cms-manage

CMS Console: https://cmsnext.console.aliyun.com/

APM Documentation: https://help.aliyun.com/zh/cms/cloudmonitor-2-0/

CLI Installation Guide: https://help.aliyun.com/zh/cli/install-update-alibaba-cloud-cli

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLIAutomationObservabilityKubernetesAI AgentCloud Monitoring
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.