ARMS Application Monitoring lets you monitor Go applications in a generic Kubernetes environment, including their application topology, API calls, errors and slow transactions, and SQL analysis. This topic describes how to connect these applications to ARMS Application Monitoring.
This topic is for non-ACK Kubernetes clusters only. For Container Service for Kubernetes (ACK) clusters, see Install the Go probe for ACK and Container Compute Service (ACS) clusters by using the ack-onepilot component.
Prerequisites
-
The kube-apiserver component in your Kubernetes cluster must be version 1.10 or later.
-
If your Kubernetes cluster is not deployed on Alibaba Cloud, it must have internet access or be connected to an Alibaba Cloud VPC, for example, via Cloud Enterprise Network (CEN).
-
Your Go application must be version 1.18 or later.
Step 1: Compile the Golang application image
(Optional) If your project includes a `vendor` directory during compile-time, add
-mod=vendoraftergo build.You can use the
wgetcommand to download the compile tool instgo. Select the download address based on your compile-time environment and the region of your build machine.Note that instgo triggers automatic updates during compile-time. Save instgo in a directory where the build user has write permissions.
NoteInstgo is a Golang application compile tool provided by ARMS. After you compile your Golang project using instgo, ARMS begins monitoring your Golang application.
The compile tools downloaded for each region are identical. If your public network environment can access OSS addresses, use the Hangzhou public network address corresponding to your operating system and architecture to obtain the compile tool.
You must grant execute permissions to the compile tool.
Linux/Mac
# Grant execute permissions chmod +x instgoWindows
No execute permissions are required in Windows.
(Optional) You can configure the LicenseKey or UID as a compile parameter.
ImportantIf you skip this step, instgo installs the latest version of the ARMS probe by default.
You can obtain the LicenseKey using the DescribeTraceLicenseKey OpenAPI.
On the DescribeTraceLicenseKey document page, click Debug, select a region, and then click Initiate Call to obtain the LicenseKey.

You can use the `set` command to configure the UID or LicenseKey as a compile parameter.
instgo set --uid={YourAliyunUid} // Requires instgo version 1.4.5 or later. The UID is your Alibaba Cloud account UID. instgo set --licenseKey=${YourLicenseKey} // Configure either the UID or the LicenseKey.
Add `instgo` as a prefix to your existing compile command and execute the compilation.
instgo go build {arg1} {arg2} {arg3}If you use `go install` to compile your project, you can also add `instgo` as a prefix to your existing compile command and execute the compilation.
Build the image using the binary file compiled in the previous step.
Step 2: Install Helm 3
Step 3: Install the agent
Application Real-Time Monitoring Service (ARMS) supports only stateless (Deployment) and stateful (StatefulSet) applications. The onboarding steps are the same for both. This example demonstrates how to connect a stateless (Deployment) application in Kubernetes to ARMS.
-
Run the following
wgetcommand to download the ack-onepilot installation package.wget 'https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/ack-onepilot-5.1.1.tgz' -
Run the following command to extract the ack-onepilot installation package.
tar xvf ack-onepilot-5.1.1.tgz -
Edit the values.yaml file in the installation package. Modify the following parameters to match your environment, then save the file.
registry: registry-__ACK_REGION_ID__.ack.aliyuncs.com/acs/ cluster_id: __ACK_CLUSTER_ID__ accessKey: __ACCESSKEY__ accessKeySecret: __ACCESSKEY_SECRET__ uid: "__ACK_UID__" region_id: __ACK_REGION_ID__-
registry: The image registry for ack-onepilot. -
cluster_id: A custom cluster ID that uniquely identifies your Kubernetes cluster. We recommend the format<uid>-<clusterid>. -
accessKeyandaccessKeySecret: The AccessKey ID and AccessKey Secret of your Alibaba Cloud account (main account). To obtain them, see Create an AccessKey.ImportantEnsure the main account has theAliyunARMSFullAccess andAliyunSTSAssumeRoleAccess permissions.
-
uid: The ID of your Alibaba Cloud account (main account). You can obtain this by hovering over your profile picture in the upper-right corner of the Alibaba Cloud console. -
region_id: The Alibaba Cloud region ID. For a list of supported regions, see Available regions.
-
-
Run the following command to install ack-onepilot.
Run this command from outside the ack-onepilot installation package directory.
helm3 upgrade --install ack-onepilot ack-onepilot --namespace ack-onepilot --create-namespace
Step 4: Modify the Deployment's YAML file
-
Run the following command to view the YAML file for the target Deployment.
kubectl get deployment {deployment-name} -o yamlNoteIf you do not know the
{deployment-name}, run the following command to list all Deployments. Then, find the name of the target Deployment in the output.kubectl get deployments --all-namespaces -
Edit the target Deployment's YAML file.
kubectl edit deployment {deployment-name} -o yaml -
In the YAML file, add the following content under
spec.template.metadata.labels: aliyun.com/app-language: "golang" # Required for Go applications. armsPilotAutoEnable: "on" armsPilotCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with your application name.If you need to create a new Deployment in your K8s environment and connect it to ARMS, use the following complete YAML file:
Result
The integration is successful if the Go application appears in the ARMS console under and begins reporting data within about one minute.