Use Application Real-Time Monitoring Service (ARMS) to monitor Python applications deployed in an Alibaba Cloud Container Service for Kubernetes (ACK) cluster. Supported frameworks include Django, Flask, FastAPI, LlamaIndex, and Langchain. ARMS provides application topology, tracing analysis, API call analysis, anomaly detection, and detailed tracing of large language model (LLM) interactions.
Choose an installation path
ARMS supports two ways to instrument your Python application. Choose one based on your ack-onepilot version:
| Path | When to use | Steps required |
|---|---|---|
| Manual agent installation (this page) | ack-onepilot version is below 5.0.0, or you want full control over agent installation | Steps 1–5 |
| Auto-instrumentation | ack-onepilot version is later than 5.0.0 and you prefer a zero-Dockerfile-change setup | Skip Step 3. In Step 4, add all three labels plus armsAutoInstrumentationEnable: "on". ack-onepilot automatically downloads and injects the Python agent. |
Prerequisites
Before you begin, ensure that you have:
-
A namespace in your ACK cluster. This guide uses a namespace named
arms-demo. See Manage namespaces and resource quotas. -
Python 3.8 or later. ARMS is not compatible with earlier Python versions.
-
ARMS activated. See Activate ARMS.
Step 1: Install the ack-onepilot add-on
ack-onepilot replaces the deprecated arms-pilot component and is fully compatible with it—no application configuration changes are needed.
-
Log on to the ACK console. In the left navigation pane, click ACK consoleACK consoleACK consoleACK consoleClusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, click Add-ons.
-
In the Logs and Monitoring section, find ack-onepilot and click Install. In the dialog box that appears, use the default values and click OK.
Use ack-onepilot version 3.2.4 or later. By default, ack-onepilot supports up to 1,000 pods. For every additional 1,000 pods, increase ack-onepilot's CPU by 0.5 cores and memory by 512 MB.
After installation, you can upgrade, configure, or uninstall ack-onepilot from the Add-ons page.
For migration from arms-pilot, see How do I uninstall arms-pilot and install ack-onepilot?
Step 2: Authorize ARMS to access resources
ARMS uses addon.arms.token for password-free authorization. Most ACK managed clusters include this secret by default. Some older clusters may not.
Check whether your cluster has the token:
If the token is missing, grant permissions manually:
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, click Cluster Information.
-
On the Basic Information tab, under Cluster Resources, click the link next to Worker RAM Role.
-
On the Permissions tab, click Grant Permission.
-
Select the AliyunARMSFullAccess policy and click Grant permissions.
If your cluster is connected to an Elastic Container Instance (ECI), go to the RAM Quick Authorization page and complete the authorization. Then restart the pods created for ack-onepilot.
Step 3: Integrate the Python agent into the Dockerfile
Modify your Dockerfile to install and start the Python agent. The changes involve three lines:
-
Install
aliyun-bootstrapfrom PyPI — the installer tool for the ARMS Python agent. -
Run the agent installer — downloads and configures the agent using your Alibaba Cloud region ID.
-
Change the startup command — wrap your application with
aliyun-instrumentto activate monitoring.
To install a specific agent version, runaliyun-bootstrap -a install -v <version>instead ofaliyun-bootstrap -a install. For available versions, see Python agent release notes.
After editing the Dockerfile, build your image and push it to your registry.
Step 4: Enable ARMS application monitoring
Add labels to your Deployment's pod template to activate monitoring.
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Workloads > Deployments.
-
On the Deployments page, click
> Edit YAML for the target application. -
Under
spec.template.metadata, add the following labels:labels: aliyun.com/app-language: python # Required. Identifies this as a Python application. armsPilotAutoEnable: 'on' armsPilotCreateAppName: "deployment-name" # The display name of the application in ARMS.Replace
deployment-namewith the name you want to display in the ARMS console.
If your ack-onepilot version is later than 5.0.0, it automatically downloads and injects the Python agent—no Dockerfile changes are needed. If you have already installed the agent manually in the container (Step 3), disable auto-injection by adding the following label:
armsAutoInstrumentationEnable: "off"
The following YAML creates two Deployments (arms-python-client and arms-python-server) and two Services in the arms-demo namespace, with ARMS monitoring enabled.
Step 5: View monitoring data
After about one minute, your application appears in the ARMS console.
-
Go to the ARMS console and navigate to Application Monitoring > Application List.

-
Click the application name to view detailed metrics. For a full description of the monitoring page, see Application Overview.
Troubleshooting
If your application does not appear in the ARMS console after one minute, check the following:
Verify that pods are running and labels are applied:
kubectl get pods -n arms-demo
kubectl describe pod <pod-name> -n arms-demo | grep -A 10 "Labels:"
Confirm the pod labels include armsPilotAutoEnable: on and aliyun.com/app-language: python.
Common causes of missing monitoring data:
| Symptom | Likely cause | Fix |
|---|---|---|
| Application not in ARMS console | Labels missing or misspelled | Re-check label names in the Deployment YAML |
| Application listed but no data | Python version below 3.8 | Upgrade to Python 3.8 or later |
| Application listed but no data | Agent not installed (manual path) | Verify the Dockerfile includes both the aliyun-bootstrap install line and the aliyun-instrument CMD |
| Authorization errors in pod logs | addon.arms.token missing |
Complete Step 2 and restart affected pods |
(Optional) Release resources
To stop monitoring, uninstall the Python agent. See Uninstall the Python agent.
What's next
-
Application Overview — explore metrics, traces, and topology in ARMS
-
Python agent release notes — track agent version updates
-
What is Application Real-Time Monitoring Service? — learn more about ARMS capabilities