All Products
Search
Document Center

Application Real-Time Monitoring Service:Monitor multi-container applications in a single pod

Last Updated:Mar 11, 2026

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:

LabelPurposeExample value
apsara.apm/container.<container-name>.app-languageSpecifies the application languagejava, golang, python
apsara.apm/container.<container-name>.armsPilotAutoEnableEnables auto-instrumentation'on'
apsara.apm/container.<container-name>.armsPilotCreateAppNameSets the ARMS application namemy-java-service

Replace <container-name> with the actual container name defined in spec.containers[].name.

Important

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:

Add monitoring labels to your Deployment

Edit an existing Deployment

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, find your cluster and click its name. In the left navigation pane, choose Workloads > Deployments.

  3. On the Deployments page, click image > Edit YAML next to your Deployment.

  4. Add the following labels under spec.template.metadata.labels for 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: 512Mi

Verify 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-labels

Verify that the output includes the apsara.apm/container.<container-name>.* labels for each monitored container.

Verify data in the ARMS console

  1. Log on to the ARMS console.

  2. In the left navigation pane, choose Application Monitoring > Application List.

  3. Confirm that your applications (for example, multilanguage-java, multilanguage-go, and multilanguage-python) appear in the list and show reported data.

Verification: applications appear in the ARMS Application List

Troubleshooting

If an application does not appear in the ARMS console within a few minutes, check the following:

SymptomCheckAction
No application in ARMS consoleLabel formatThe 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 injectedack-onepilot versionRun 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 errorsPod eventsRun kubectl describe pod <pod-name> -n <namespace> and check for errors related to init-container injection or agent startup.
Labels missing on podLabel propagationRun kubectl get pod <pod-name> -n <namespace> --show-labels to confirm the monitoring labels are present on the running pod.

What's next