If you no longer need Application Real-Time Monitoring Service (ARMS) to monitor your Go applications, you can uninstall the ARMS agent. This topic describes how to uninstall an ARMS agent for Go, remove code enhancements from the agent, and clean up the residue caused by mixed compilation failures.
Uninstall an ARMS agent deployed in an ACK cluster
The ack-onepilot component is shared by Microservices Engine (MSE) and ARMS. Before you uninstall the component, make sure that you are not using MSE. Otherwise, MSE becomes available.
Uninstall the ARMS agent for all applications in the cluster
Method 1: Use the ACK console
Log on to the Container Service for Kubernetes (ACK) console.
In the left-side navigation pane, click Clusters. On the Clusters page, click the name of the cluster.
In the left-side navigation pane, choose
. On the Add-ons page, enter ack-onepilot in the upper-right corner.Click Uninstall on the ack-onepilot card.
In the message that appears, click OK.
Restart the pod.
Method 2: Use the CLI
Run the following command to uninstall the ack-onepilot component:
helm3 uninstall --namespace ack-onepilot ack-onepilot
Restart the pod.
Uninstall the ARMS agent for a specific application in the cluster
Log on to the ACK console. In the left-side navigation pane, click Clusters. On the Clusters page, find the cluster and click Applications in the Actions column.
On the Deployments page, choose
in the Actions column of the application.In the Edit YAML dialog box, delete the
labels
that you added when you installed the ARMS agent and click Update.Restart the pod.
Uninstall an ARMS agent that is manually installed
Generally, instgo restores your code base after the mixed compilation is completed. If you no longer need the code enhancements provided by the ARMS agent, you do not need to delete instgo. Instead, you can perform the following operations to replace instgo with Go and recompile your application.
(Optional) Pull the code base and recompile it by running the
go build
command.Deploy the application in the production environment in place of the original one.
Clean up the residue caused by mixed compilation
During the mixed compilation, the ARMS agent for Go modifies some of your files to add code enhancements. After the mixed compilation is complete, the ARMS agent for Go automatically cleans up the modified files. However, you must manually clean up the files in the following scenarios:
The compilation was forcibly stopped or killed.
instgo unexpectedly exited due to panic.
In the preceding scenarios, you can manually run theclean
command to clean up the modified files.
Linux/Darwin
./instgo clean
Windows
.\instgo.exe clean
Delete instgo
If you no longer need instgo, perform the following steps to delete it.
Delete all files in the cache directory specified by the
--cacheDir
command during compilation. If no cache directory is specified, use the default cache directory.Linux/Darwin
# Replace ${cacheDir} with the specified cache directory. rm -rf ${cacheDir}/aliyun-go-agent # Use the default cache directory. rm -rf /opt/.opt/aliyun-go-agent
Windows
# Replace ${cacheDir} with the specified cache directory. rmdir ${cacheDir}\aliyun-go-agent -Recurse # Use the default cache directory. rmdir C:\ProgramData\.opt\aliyun-go-agent -Recurse
Delete instgo.