arms-obi is a Kubernetes DaemonSet agent that discovers and collects Go pprof data from application Pods on each node, then uploads the data to Cloud Monitor for continuous profiling through ARMS Profiling.
Key capabilities
-
Auto-discovers Pods on the current node that expose a pprof interface.
-
Collects five profile types: CPU, heap, goroutine, mutex, and block.
-
Exposes a health check endpoint for Kubernetes liveness and readiness probes.
-
Collects data concurrently from more than 50 Pods per node.
Prerequisites
-
A Kubernetes cluster, version 1.32 or later.
-
Your application Pods expose the Go
net/http/pprofHTTP interface. -
Your application Pod's containers must have an environment variable that specifies the pprof port. The default variable is
ILOGTAIL_PROFILE_PORT, which you can change in the values configuration.
Integrate your application
Your Go service must expose the pprof HTTP interface and set a port environment variable in its container. Skip this section if both are already configured.
Code integration
In the main package of your Go service, import net/http/pprof and start a separate HTTP server:
import _ "net/http/pprof"
func main() {
// Start the pprof server on a separate port to avoid conflicts with the business port.
go func() {
http.ListenAndServe(":6060", nil)
}()
// ... business logic
}
Container environment variables
In your application Pod's container spec, set the pprof port environment variable. The variable name defaults to ILOGTAIL_PROFILE_PORT and is configurable in the values:
containers:
- name: myapp
env:
- name: ILOGTAIL_PROFILE_PORT # Must match the port_env_name configured in arms-obi
value: "6060"
arms-obi reads this environment variable to determine the target port.
Deployment
ACK cluster
-
Log on to the Container Service for Kubernetes (ACK) console. In the left-side navigation pane, select Cluster List, and then click the name of the target cluster.
-
In the left-side navigation pane, select Components, find the
arms-obicomponent, set installMode to profiling, and then click Install. -
By default, the agent collects data from Pods with the
ILOGTAIL_PROFILE_PORTenvironment variable set, and uses the value of theapplabel for the application name. To customize this, modify the collector configuration in the profiling section during installation. For more information about configuration parameters, see Collector configuration.
External cluster
-
Run the following
wgetcommand to download the arms-obi installation package.wget 'https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/app/charts-incubator/arms-obi-0.9.3.tgz' -
Run the following command to extract the arms-obi installation package.
tar xvf arms-obi-0.9.3.tgz -
Edit the values.yaml file in the installation package. Modify the following parameters and save the file.
ImportantEnsure that your main Alibaba Cloud account has the AliyunARMSFullAccess and AliyunSTSAssumeRoleAccess permissions.
workspace: default-cms-__ACK_UID__-__ACK_REGION_ID__ 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__ installMode: profilingworkspace: Replace __ACK_UID__ with the UID of your Alibaba Cloud main account and __ACK_REGION_ID__ with the ID of the region where you want to report data.registry: Address of the arms-obi image repository. arms-obi includes three images. If your cluster cannot access the public network, synchronize these images to your internal repository:registry-cn-hangzhou.ack.aliyuncs.com/acs/obi:obi-app-update-0.9.3 registry-cn-hangzhou.ack.aliyuncs.com/acs/obi:init-0.9.3 registry-cn-hangzhou.ack.aliyuncs.com/acs/obi:pprof-agent-0.9.3cluster_id: Custom ID for your Kubernetes cluster. Must be unique.accessKeyandaccessKeySecret: AccessKey ID and AccessKey Secret of your main Alibaba Cloud account. For more information, see Create an AccessKey pair.uid: ID of your main Alibaba Cloud account. Find this by hovering over your profile picture in the upper-right corner of the Alibaba Cloud console.region_id: Alibaba Cloud region ID. For supported regions, see Supported regions.installMode: Must be set toprofiling. -
Run the following command to install arms-obi. Run this command from outside the arms-obi installation package directory.
helm3 upgrade --install arms-obi arms-obi --namespace obi-system --create-namespace
Configuration
Collector configuration
|
Field |
Type |
Default |
Description |
|
profiles |
[ ]string |
All 5 types |
Allowed profile types. Valid values: cpu, heap, goroutine, mutex, and block. |
|
interval |
int |
30 |
Collection interval in seconds. |
|
timeout |
int |
30 |
Timeout for a single HTTP request in seconds. |
|
max_body_size |
int |
10240 |
Maximum size of a single response body in KB. Responses larger than this are discarded. |
|
cpu_duration |
int |
10 |
Duration for CPU profile sampling in seconds. This value must be less than |
|
port_env_name |
string |
ILOGTAIL_PROFILE_PORT |
Name of the environment variable in the container that specifies the pprof port. |
|
pprof_path |
string |
/debug/pprof |
Path prefix for the pprof HTTP endpoint. |
Profile collection URLs follow this pattern: http://<podIP>:<port><pprof_path>/<profile>
|
Profile type |
URL path |
Remarks |
|
cpu |
/profile?seconds=<cpu_duration> |
Collection duration = cpu_duration seconds |
|
heap |
/heap |
Instantaneous collection |
|
goroutine |
/goroutine |
Instantaneous collection |
|
mutex |
/mutex |
Instantaneous collection |
|
block |
/block |
Instantaneous collection |
Filter configuration
Controls which Pods to collect from. All conditions are combined with AND; items within a whitelist are combined with OR.
|
Field |
Type |
Default |
Description |
|
namespace |
string |
"" |
Regular expression to match the Pod namespace. If empty, no filtering is applied. |
|
pod_name |
string |
"" |
Regular expression to match the Pod name. If empty, no filtering is applied. |
|
label_whitelist |
[ ]LabelKV |
[ ] |
Allowed Pod labels. A Pod is matched if it has any of these labels. |
|
label_blacklist |
[ ]LabelKV |
[ ] |
Blocked Pod labels. A Pod is excluded if it has any of these labels. |
|
env_whitelist |
[ ]LabelKV |
[ ] |
Allowed container environment variables. A Pod is matched if any of its containers define one of these variables. |
|
env_blacklist |
[ ]LabelKV |
[ ] |
Blocked container environment variables. A Pod is excluded if any of its containers define one of these variables. |
LabelKV format: {key: "app", value: "myservice"}. If the value is empty, the agent only checks for the key's existence.
The filter pipeline runs in this order:
-
Node filtering: Collects only from Pods on the current node (automatic).
-
Pod Phase: Keeps only Pods in the Running phase with an assigned IP address.
-
Regular expression filtering:
namespace/pod_name. -
Label whitelist → Label blacklist.
-
Environment variable whitelist → Environment variable blacklist.
-
Port resolution: Reads the port value from the container environment variable specified by
port_env_name.
ARMS configuration
|
Field |
Type |
Default |
Description |
|
arms.license_key |
string |
app |
Key of the Pod label whose value is used as the ARMS application name (appName). |
Update the configuration
-
Log on to the Container Service for Kubernetes (ACK) console. In the left-side navigation pane, select Cluster List, and then click the name of the target cluster.
-
In the left-side navigation pane, select Components, find the
arms-obicomponent, click Configure, and then modify the profiling collector configuration.
View profiling data
-
Log on to the Cloud Monitor console, select the target workspace, and in the left-side navigation pane, click Application Monitoring.
-
Find the application with the name you defined during deployment. Click Application Diagnostics to view profile types. You can also download profile files for local analysis with pprof.
FAQ
Agent logs show "arms sts not ready yet"
The agent failed to obtain an ARMS STS credential.
-
Ensure that the cluster network can access the ARMS metadata API at
<region_id>-intranet-arms.aliyuncs.com. -
You can run
kubectl logsto view detailed error messages.
No Pods are discovered
Check your filter configuration:
-
Confirm that the environment variable specified by
port_env_name(default: ILOGTAIL_PROFILE_PORT) is set in your application's Pod containers. -
Confirm that the regular expressions for
namespace/pod_name, as well as the label and environment variable whitelist and blacklist settings in the selector, are correct. -
Check the
pod_countfield in the agent logs to see how many Pods were discovered.
Collection fails
Common causes:
-
The application Pod does not expose the pprof interface. Confirm that you have imported
_ "net/http/pprof"and started the HTTP service. -
The pprof port does not match the port configured in the
port_env_nameenvironment variable. -
The
pprof_pathdoes not match the path prefix of your service. -
A network policy is blocking the HTTP connection from the agent Pod to the application Pod.
Upload fails
Common causes:
-
The VPC private endpoint is unreachable.
-
The ARMS STS credential has expired. The agent refreshes the credential automatically. Check the logs for STS refresh errors.