ARMS uses instgo, a compile-time instrumentation tool that wraps your go build command to embed the Application Real-Time Monitoring Service (ARMS) agent into the compiled binary. The instrumented binary reports traces, topology, and SQL analysis data to ARMS at runtime -- no source code changes required. This guide walks you through building an instrumented binary in a DevOps Flow pipeline, deploying it, and verifying that monitoring data appears in the ARMS console.
How it works
Instead of modifying source code, prefix your go build command with instgo to inject the ARMS agent at compile time. The instrumented binary reports data to ARMS automatically at runtime.
Source code --> instgo go build --> Instrumented binary --> Deploy --> ARMS consolePrerequisites
Before you begin, make sure that you have:
ARMS is activated
An ARMS license key, retrieved by calling the DescribeTraceLicenseKey API -- on the API documentation page, click Debug, then click Initiate Call in OpenAPI Explorer to get your key

Step 1: Build the instrumented binary
Download instgo
Download instgo for your OS and architecture from the region where your environment resides. Store it in a directory with write permissions, because instgo downloads dependencies during compilation.
If your build machine can access Object Storage Service (OSS) over the Internet, you can directly use the public endpoint of the China (Hangzhou) region to download instgo.
The download URL follows this pattern:
# Public endpoint
http://arms-apm-<region-id>.oss-<region-id>.aliyuncs.com/instgo/instgo-<os>-<arch>
# VPC endpoint
http://arms-apm-<region-id>.oss-<region-id>-internal.aliyuncs.com/instgo/instgo-<os>-<arch>Replace the placeholders with actual values:
| Placeholder | Description | Example |
|---|---|---|
<region-id> | Alibaba Cloud region ID | cn-hangzhou |
<os> | Operating system | linux, darwin, windows |
<arch> | CPU architecture | amd64, arm64 |
For Windows, the binary filename is instgo-windows-amd64.exe.Example: Download instgo for Linux AMD64 from the China (Hangzhou) region:
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-linux-amd64" -O instgoSupported regions and their IDs
| Region | Region ID |
|---|---|
| China (Hangzhou) | cn-hangzhou |
| China (Shanghai) | cn-shanghai |
| China (Qingdao) | cn-qingdao |
| China (Beijing) | cn-beijing |
| China (Zhangjiakou) | cn-zhangjiakou |
| China (Hohhot) | cn-huhehaote |
| China (Ulanqab) | cn-wulanchabu |
| China (Shenzhen) | cn-shenzhen |
| China (Heyuan) | cn-heyuan |
| China (Guangzhou) | cn-guangzhou |
| China (Chengdu) | cn-chengdu |
| China (Hong Kong) | cn-hongkong |
| Singapore | ap-southeast-1 |
| Malaysia (Kuala Lumpur) | ap-southeast-3 |
| Indonesia (Jakarta) | ap-southeast-5 |
| Japan (Tokyo) | ap-northeast-1 |
| Germany (Frankfurt) | eu-central-1 |
| UK (London) | eu-west-1 |
| US (Virginia) | us-east-1 |
| US (Silicon Valley) | us-west-1 |
Supported OS and architecture combinations: Linux (AMD64, ARM64), macOS (AMD64, ARM64), Windows (AMD64).
Grant execute permissions
On Linux or macOS, make the binary executable:
chmod +x instgoOn Windows, no additional permissions are needed.
Configure the license key
Set the license key and region before building. The --dev=false flag configures instgo for production use:
./instgo set --licenseKey=<your-license-key> --regionId=<your-region-id> --dev=falseReplace the placeholders with actual values:
| Placeholder | Description | How to get it |
|---|---|---|
<your-license-key> | ARMS license key | See Prerequisites. |
<your-region-id> | Region where your application runs | For example, cn-hangzhou. See the full list in Supported regions above. |
If you skip this step, instgo enters Dev mode and installs the latest ARMS agent version. For production deployments, always configure the license key explicitly.
Build with instgo
Prefix your existing go build command with instgo:
./instgo go build -o myapp .The output binary (myapp in this example) contains the embedded ARMS agent and is ready for deployment.
Build the container image
Use the instrumented binary to build a container image. The following multi-stage Dockerfile integrates instgo into the build:
FROM golang:1.21 AS build
WORKDIR /app
# Copy dependency files first for better layer caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Download and set up instgo (China (Hangzhou) region, Linux AMD64)
RUN wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo \
&& chmod +x instgo \
&& ./instgo set --licenseKey=<your-license-key> --regionId=<your-region-id> --dev=false
# Build with ARMS instrumentation
RUN ./instgo go build -o myapp .
# Runtime stage
FROM debian:bookworm-slim
COPY --from=build /app/myapp /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/myapp"]Replace <your-license-key> and <your-region-id> with your actual values. Adjust the instgo download URL if your build environment uses a different region or architecture.
Step 2: Deploy the application
Deploy the instrumented application to either a Container Service for Kubernetes (ACK) cluster or an Elastic Compute Service (ECS) instance.
Deploy to an ACK cluster
Log on to the ACK console. In the left-side navigation pane, click Clusters.
Select the resource group and region of your cluster, then click the cluster name.
In the left-side navigation pane, choose Workloads > Deployments, StatefulSets, or DaemonSets depending on your workload type.
Find the target application. In the Actions column, click the more icon (
) and select Edit YAML. To monitor a new Go application, click Create from YAML on the Deployments page instead.Add the following labels under
spec.template.metadata:labels: aliyun.com/app-language: golang # Required. Identifies a Go application. armsPilotAutoEnable: 'on' # Required. Enables ARMS monitoring. armsPilotCreateAppName: "<your-deployment-name>" # Required. Replace with your Deployment name.
Save the YAML and wait for the pods to restart.
Deploy to an ECS instance
Before running the instrumented binary, export the following environment variables:
export ARMS_ENABLE=true
export ARMS_APP_NAME=<your-app-name> # Application name shown in the ARMS console
export ARMS_REGION_ID=<your-region-id> # Region ID, for example, cn-hangzhou
export ARMS_LICENSE_KEY=<your-license-key> # License key from Prerequisites
./myappThe following table describes each variable:
| Variable | Description | Example |
|---|---|---|
ARMS_ENABLE | Enables ARMS monitoring | true |
ARMS_APP_NAME | Application name displayed in the ARMS console | my-go-service |
ARMS_REGION_ID | Region where ARMS collects monitoring data | cn-hangzhou |
ARMS_LICENSE_KEY | ARMS license key | See Prerequisites |
Verify the result
After about one minute, check the ARMS console to confirm monitoring is active:
Log on to the ARMS console.
In the left-side navigation pane, choose .
Confirm that your application appears on the Application List page.

After the application appears, click its name to access:
Application topology: Visualize dependencies between your services.
Traces: Inspect individual request traces to identify latency bottlenecks.
SQL analysis: Analyze slow SQL queries and database call patterns.
If your application does not appear after a few minutes, verify that the license key and region ID are correct, and that the application can reach the ARMS endpoint in your region.
What's next
instgo tool reference: Learn about advanced instgo options and supported frameworks.
ARMS Application Monitoring overview: Explore alerting, dashboards, and custom instrumentation.