All Products
Search
Document Center

Application Real-Time Monitoring Service:Monitor a Go application deployed in an ACK cluster

Last Updated:Mar 11, 2026

Set up ARMS Application Monitoring to collect traces, track performance metrics, and configure alerting for Go applications running in Container Service for Kubernetes (ACK).

Note

This guide covers ACK deployments. For other environments, see Application monitoring.

How it works

Monitoring a Go application in ACK involves three components:

  1. ack-onepilot -- An ACK cluster component that connects Java or Go applications deployed in ACK clusters to the ARMS backend.

  2. instgo -- An ARMS build tool that instruments your Go binary at compile time. Go compiles to a static binary, so instrumentation must happen during the build (unlike Java, which supports runtime injection).

  3. Pod labels -- Kubernetes labels on your Deployment that tell ack-onepilot which pods to monitor and what name to display in the ARMS console.

Data flow:

Go binary (compiled with instgo) --> ack-onepilot (collects traces) --> ARMS backend --> ARMS console

Setup overview:

StepActionWhere
1. Install ack-onepilotInstall the cluster componentACK console
2. Compile with instgoBuild an instrumented Go binaryYour build environment
3. Add pod labelsEnable monitoring per DeploymentDeployment YAML

Prerequisites

ACK cluster:

ARMS:

  • Application Monitoring activated with the pay-by-observable-data billing mode enabled

  • Application Monitoring includes a free monthly quota of 50 GB. Unused quota does not carry over to the next month. If usage exceeds the free quota, standard rates apply. For pricing details, see Billing

Sample application (optional)

If you do not have a Go application ready, deploy the following sample to follow along. It creates two Deployments (otel-go-client and otel-go-server) and one Service (otel-server) in the default namespace. See Create a stateless application by using a Deployment.

View the sample YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: otel-go-client
  name: otel-go-client
  namespace: default
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: otel-go-client
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: otel-go-client
    spec:
      containers:
        - image: registry.cn-hangzhou.aliyuncs.com/private-mesh/hellob:otel-client-arms-go-test-0.0.1
          imagePullPolicy: Always
          name: client
          resources:
            requests:
              cpu: 250m
              memory: 300Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

---

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: otel-go-server
  name: otel-go-server
  namespace: default
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: otel-go-server
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: otel-go-server
    spec:
      containers:
        - image: registry.cn-hangzhou.aliyuncs.com/private-mesh/hellob:otel-server-arms-go-test-0.0.1
          imagePullPolicy: Always
          name: server
          resources:
            requests:
              cpu: 250m
              memory: 300Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

---

apiVersion: v1
kind: Service
metadata:
  labels:
    app: otel-go-server
  name: otel-server
  namespace: default
spec:
  internalTrafficPolicy: Cluster
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  ports:
    - name: http
      port: 9000
      protocol: TCP
      targetPort: 9000
  selector:
    app: otel-go-server
  sessionAffinity: None
  type: ClusterIP
Note

The sample application images are pre-compiled with instgo. If you use the sample YAML as-is, skip Step 2: Compile the application with instgo and go directly to Step 3: Add pod labels.

Step 1: Install ack-onepilot

  1. Log on to the ACK console. On the Clusters page, click the name of your cluster.

  2. In the left-side navigation pane, click Add-ons. On the Add-ons page, search for ack-onepilot.

  3. In the ack-onepilot section, click Install. In the dialog box that appears, click OK.

Note

ack-onepilot version 3.2.0 or later is required.

Install ack-onepilot from the Add-ons page

Step 2: Compile the application with instgo

instgo is the ARMS build tool for Go. It wraps go build and injects instrumentation into your binary at compile time. Store instgo in a writable directory, because it triggers automatic updates during compilation.

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 your values:

PlaceholderDescriptionExamples
<region-id>The region where your environment residescn-hangzhou, ap-southeast-1, us-east-1
<os>-<arch>Your operating system and CPU architecturelinux-amd64, linux-arm64, darwin-arm64, darwin-amd64, windows-amd64 (add .exe suffix for Windows)
Note

If you can access OSS over the Internet, use the public endpoint from any region. The China (Hangzhou) region (cn-hangzhou) is recommended for public downloads.

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 instgo

Supported regions

The following regions are available for instgo downloads. Use the region closest to your build environment.

RegionRegion 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
Singaporeap-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

Grant execute permissions

On Linux or macOS, make instgo executable:

chmod +x instgo

On Windows, no additional permissions are needed.

Configure the license key (production only)

If you skip this step, instgo runs in Dev mode and installs the latest ARMS agent version. For production deployments, configure a license key.

  1. Open the DescribeTraceLicenseKey API reference page and click Debug. In OpenAPI Explorer, click Initiate Call to retrieve your license key.

    Retrieve license key from OpenAPI Explorer

  2. Set the license key and region:

       instgo set --licenseKey=${YourLicenseKey} --regionId=${YourRegionId} --dev=false

Build the instrumented binary

Prefix your existing go build command with instgo:

instgo go build {arg1} {arg2} {arg3}

Build the container image

Use the binary file compiled in the previous step to build your container image.

Step 3: Add pod labels to your Deployment

Add three labels under spec.template.metadata.labels to enable ARMS monitoring for a Deployment.

labels:
  aliyun.com/app-language: golang    # Identifies this as a Go application
  armsPilotAutoEnable: 'on'          # Enables ARMS monitoring
  armsPilotCreateAppName: "<your-deployment-name>"  # Display name in the ARMS console

To add these labels through the ACK console:

  1. In the left-side navigation pane, choose Workloads > Deployments. Select the namespace where your Deployment resides.

  2. Find your Deployment and choose More icon > Edit YAML in the Actions column.

  3. In the Edit YAML dialog box, add the three labels under spec.template.metadata.labels and click Update.

Example: The following screenshots show the labels added to the otel-go-client and otel-go-server sample Deployments.

otel-go-client:

otel-go-client Deployment

otel-go-client YAML with ARMS labels

otel-go-server Deployment

otel-go-server YAML with ARMS labels

Verify that monitoring is working

After updating the Deployment YAML, the pods redeploy automatically. Wait 1--2 minutes for trace data to appear.

  1. In the ARMS console, navigate to Application Monitoring > Application List.

  2. Click the name of your application to view its monitoring data.

Application list in the ARMS console

View monitoring data

For a full walkthrough, see View monitoring details.

Trace Explorer

Trace Explorer lets you filter and aggregate trace data in real time. Use it to identify failed or slow calls and drill into individual traces.

Trace Explorer overview

Click a trace to view its call chain, including timing, status codes, and span details.

Trace details view

Metrics

The application overview page shows key performance indicators such as request count, response time, and error rate.

Application overview metrics

The topology view maps dependencies between services, showing request flow and latency at each hop.

Service topology view

Configure alerting

Set up alert rules to get notified when performance degrades or errors spike. Notifications can be sent to contacts or DingTalk group chats. For details, see Alert rules.

Alert configuration page

Clean up resources

After completing this guide:

  • To keep monitoring active: Make sure your Alibaba Cloud account has no overdue payments.

  • To stop monitoring: Uninstall the ARMS agent from your application. For instructions, see Uninstall the Golang agent.

See also