Monitor multi-container applications in a single pod
In a sidecar scenario, a single pod can run multiple containers with applications written in various programming languages. This topic explains how to use the ack-onepilot component to instrument these polyglot applications.
Prerequisites
The ack-onepilot version is 4.2.0 or later.
Procedure
-
Install ack-onepilot and grant it the required resource access permissions as described in one of the following topics:
-
Add the required labels to the workload.
The preceding YAML defines an application that uses Java, Go, and Python in three separate containers:
test-java,test-go, andtest-python.To isolate monitoring data, instrument each container to report data to a separate ARMS application. Follow these steps:
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Stateless page, find your target application, and then choose in the Actions column.
To create a new application, click Create From YAML.
-
In the YAML file, add the following
labelsunder thespec.template.metadatasection, and then click Update.labels: # Replace ${containerName} with the actual container name. apsara.apm/container.${containerName}.app-language: java # Replace with the container's actual programming language. apsara.apm/container.${containerName}.armsPilotAutoEnable: 'on' apsara.apm/container.${containerName}.armsPilotCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with your application name.
-
The instrumentation is successful if your applications appear on the page in the ARMS console and are reporting data.
In the search box, enter
multilanguage-to filter for the three applications: multilanguage-go, multilanguage-java, and multilanguage-python.
> Edit YAML