When a pod runs containers in different languages -- such as a Java service, a Go proxy, and a Python data processor -- each container needs independent monitoring with data isolation. Configure per-container labels on your Deployment so that the ack-onepilot component registers each container as a separate Application Real-Time Monitoring Service (ARMS) application.
How it works
When a pod starts, ack-onepilot reads the pod template labels, identifies which containers to instrument, and injects the language-specific ARMS agent into each one. Each instrumented container then reports data to its own ARMS application, providing full data isolation between containers.
Three labels control instrumentation for each container:
| Label | Purpose | Example value |
|---|---|---|
apsara.apm/container.<container-name>.app-language | Specifies the application language | java, golang, python |
apsara.apm/container.<container-name>.armsPilotAutoEnable | Enables auto-instrumentation | 'on' |
apsara.apm/container.<container-name>.armsPilotCreateAppName | Sets the ARMS application name | my-java-service |
Replace <container-name> with the actual container name defined in spec.containers[].name.
The container name in each label key must exactly match spec.containers[].name. For example, if the container is named test-java, the label prefix must be apsara.apm/container.test-java., not apsara.apm/container.testjava..
Prerequisites
Before you begin, make sure that you have:
ack-onepilot 4.2.0 or later installed in your cluster
The ARMS agent installed and resource access permissions granted -- follow one of these guides:
Add monitoring labels to your Deployment
Edit an existing Deployment
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, find your cluster and click its name. In the left navigation pane, choose Workloads > Deployments.
On the Deployments page, click next to your Deployment.
Add the following labels under
spec.template.metadata.labelsfor each container that requires monitoring, then click Update.
labels:
# Replace <container-name> with the actual container name.
# Replace <language> with the container's programming language: java, golang, or python.
# Replace <app-name> with a descriptive ARMS application name.
apsara.apm/container.<container-name>.app-language: <language>
apsara.apm/container.<container-name>.armsPilotAutoEnable: 'on'
apsara.apm/container.<container-name>.armsPilotCreateAppName: "<app-name>"Create a new Deployment
Click Create From YAML and use the following example as a starting point.
Complete example
This Deployment defines three containers -- test-java, test-go, and test-python -- each registered as a separate ARMS application:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: multicontainer
name: multicontainer
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: multicontainer
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: multicontainer
# Java container monitoring labels
apsara.apm/container.test-java.app-language: java
apsara.apm/container.test-java.armsPilotAutoEnable: 'on'
apsara.apm/container.test-java.armsPilotCreateAppName: multilanguage-java
# Go container monitoring labels
apsara.apm/container.test-go.app-language: golang
apsara.apm/container.test-go.armsPilotAutoEnable: 'on'
apsara.apm/container.test-go.armsPilotCreateAppName: multilanguage-go
# Python container monitoring labels
apsara.apm/container.test-python.app-language: python
apsara.apm/container.test-python.armsPilotAutoEnable: 'on'
apsara.apm/container.test-python.armsPilotCreateAppName: multilanguage-python
spec:
containers:
- command:
- sleep
- '360000'
image: alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest
# Replace with your actual Java application image
imagePullPolicy: Always
name: test-java
resources:
requests:
cpu: 250m
memory: 512Mi
- command:
- sleep
- '3600000'
image: alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest
# Replace with actual Go application image
imagePullPolicy: Always
name: test-go
resources:
requests:
cpu: 500m
memory: 512Mi
- command:
- sleep
- '3600000'
image: alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest
# Replace with actual Python application image
imagePullPolicy: Always
name: test-python
resources:
requests:
cpu: 500m
memory: 512MiVerify monitoring
After the Deployment rolls out, confirm that each container reports data to ARMS.
Check that the ARMS agent was injected
Run the following command to verify that ack-onepilot injected the init containers:
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.spec.initContainers[*].name}'The output should include ARMS-related init containers. If no init containers appear, check the label format and ack-onepilot version.
Confirm monitoring labels on the running pod
kubectl get pod <pod-name> -n <namespace> --show-labelsVerify that the output includes the apsara.apm/container.<container-name>.* labels for each monitored container.
Verify data in the ARMS console
Log on to the ARMS console.
In the left navigation pane, choose Application Monitoring > Application List.
Confirm that your applications (for example,
multilanguage-java,multilanguage-go, andmultilanguage-python) appear in the list and show reported data.

Troubleshooting
If an application does not appear in the ARMS console within a few minutes, check the following:
| Symptom | Check | Action |
|---|---|---|
| No application in ARMS console | Label format | The container name in each label key must exactly match spec.containers[].name. For example, if the container is named test-java, the label prefix must be apsara.apm/container.test-java., not apsara.apm/container.testjava.. |
| No init container injected | ack-onepilot version | Run kubectl get deployment ack-onepilot -n kube-system -o jsonpath='{.spec.template.spec.containers[0].image}' and confirm the version is 4.2.0 or later. |
| Init container errors | Pod events | Run kubectl describe pod <pod-name> -n <namespace> and check for errors related to init-container injection or agent startup. |
| Labels missing on pod | Label propagation | Run kubectl get pod <pod-name> -n <namespace> --show-labels to confirm the monitoring labels are present on the running pod. |
> Edit YAML