To monitor Go applications running in Container Service for Kubernetes (ACK) clusters, you can install the ack-onepilot component, and compile the Go binary files of the application using the compilation tool instgo when building the container image. After deploying ack-onepilot, you can view monitoring data in Application Real-Time Monitoring Service (ARMS), such as application topology, interface calls, and database analysis.
Prerequisites
An ACK cluster is created. For more information, see Create an ACK managed cluster or Create an ACK dedicated cluster (discontinued).
Make sure that the application uses Go 1.18 or later.
ARMS is activated. For more information, see Activate ARMS.
ARMS is an application performance management (APM) service. For more information, see What is ARMS and What is Application Monitoring.
Step 1: Install the ARMS Application Monitoring component ack-onepilot
The old component arms-pilot is no longer maintained. You can install the new component ack-onepilot to monitor your application. The ack-onepilot component is fully compatible with arms-pilot. You can seamlessly install ack-onepilot without the need to modify application configurations. For more information, see How do I uninstall arms-pilot and install ack-onepilot?
Log on to the ACK console. In the navigation pane on the left, click Clusters.
On the Clusters page, find the one you want to manage and click its name. In the left-side navigation pane, click Add-ons.
In the Logs and Monitoring section, find ack-onepilot and click Install. In the dialog box that appears, configure the parameters as needed. We recommend using the default values. Then, click OK.
NoteEnsure ack-onepilot version is 3.2.4 or later. The component supports 1,000 pods by default. For every additional 1,000 pods beyond this threshold, increase CPU by 0.5 cores and memory by 512 MB.
After installing ack-onepilot, you can upgrade, configure, or uninstall it on the Add-ons page.
Step 2: Authorize ARMS to access resources
To monitor an application deployed in an ACK cluster with no
addon.arms.token, perform the following operations to authorize the ACK cluster to access ARMS. If theaddon.arms.tokenalready exists, no further authorization is needed.NoteIn ACK clusters,
addon.arms.tokenenables ARMS to automatically perform password-free authorization. Normally, ACK managed clusters haveaddon.arms.tokenby default. However, some of the ACK managed clusters created earlier may not includeaddon.arms.token.Check whether the cluster has
addon.arms.token.If
addon.arms.tokendoes not exist, perform the following these steps to manually authorize the cluster to access ARMS resources :Log on to the ACK console. In the navigation pane on the left, click Clusters.
On the Clusters page, find the cluster you want and click its name. In the left-side pane, click Cluster Information.
Click the Basic Information tab. In the Cluster Resources section, click the link to the right side of Worker RAM Role.
On the Permissions tab, click Grant Permission.
Select the AliyunARMSFullAccess policy and click OK.
To monitor an application deployed in an ACK managed cluster that is connected to an elastic container instance, go to the RAM Quick Authorization page and complete the authorization. Then, restart the pods that are created for ack-onepilot.
Step 3: Compile the Go binary file
You can compile a Go program using the enhanced Go compilation tool instgo, along with a local Go compilation environment requiring Go version 1.18 or later, to generate binary files capable of reporting monitoring data to ARMS.
Run the
wgetcommand to download instgo based on the region where the environment and machine reside. Store it in a directory where you have the write permissions, because instgo triggers automatic updates during compilation.NoteThe build tool for Go, instgo, is provided by ARMS to help you monitor your Go applications.
If you are able to access Object Storage Service (OSS) over the Internet, you can directly use the public endpoint of the operating system and architecture in the China (Hangzhou) region to obtain instgo.
Add executable permissions to instgo.
Linux/Darwin
# Grant the permissions. chmod +x instgoWindows
In Windows, you do not need to grant permissions.
Configure the license key and build parameters.
ImportantIf you skip this step, instgo enters Dev mode and installs the ARMS agent of the latest version by default. To deploy the agent in a production environment, set the
DescribeTraceLicenseKeyparameter.On the DescribeTraceLicenseKey documentation page, click Debug. In OpenAPI Explorer that appears, click Initiate Call to obtain a license key.

Run the
setcommand to set build parameters:instgo set --licenseKey=${YourLicenseKey} --regionId=${YourRegionId} --dev=false
Add instgo as a prefix to your existing build command and run the following command:
instgo go build {arg1} {arg2} {arg3}Use the binary file compiled in the previous step to build the image.
Step 4: Enable ARMS to monitor Go applications
Log on to the ACK console. In the navigation pane on the left, click Clusters.
On the Clusters page, find the cluster you want to manage and click its name. In the left-side pane, choose .
On the Deployments page, choose in the Actions column of the application you want to manage.
In the YAML file, add the following tags to
spec.template.metadata:labels: aliyun.com/app-language: golang # Specify a Go application. armsPilotAutoEnable: 'on' armsPilotCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with the Deployment name.
Step 5: View monitoring details
Wait for approximately one minute to view the monitoring data.
Log on to the ARMS Console. In the left-side navigation pane, choose to view the Go application and the reported data.

Click the Application Name to view detailed monitoring information on the application monitoring page. For more information, see Application overview.
(Optional) Step 6: Release resources
If you no longer want to monitor the application, uninstall the ARMS agent. For more information, see Uninstall an ARMS agent for Go.
References
For more information about how to connect Java or Python applications in an ACK cluster to ARMS Application Monitoring, see Java Application Monitoring and Python Application Monitoring.
> Edit YAML