為Golang應用安裝探針後,ARMS即可開始監控Golang應用,您可以查看應用拓撲、調用鏈路、SQL分析等一系列監控資料。本文介紹如何為Go應用手動安裝探針。
對於部署在Kubernetes環境的應用,不推薦手動安裝探針,建議通過安裝組件的方式接入ARMS。具體操作,請參見Container Service ACK 和容器計算服務 ACS 通過 ack-onepilot 組件安裝 Go 探針。
如果您在使用Golang探針過程中有任何問題,歡迎通過DingTalk答疑群(群號:159215000379)與我們聯絡。
前提條件
確保您的編譯環境和公網或阿里雲內網連通,且編譯環境所在安全性群組已開放8080、9990、80、443的TCP出方向許可權。
檢查您的網路環境。具體要求,請參見Golang應用監控網路設定。
檢查您的編譯環境作業系統和架構,以及Go版本和架構版本。具體要求,請參見ARMS應用監控支援的Go組件和架構。
步驟一:編譯Golang應用鏡像
(可選)若專案在編譯時間包含vendor編譯或編譯參數包含
-mod=vendor,則需要檢查:go mod檔案是否包含google.golang.org/protobuf依賴(間接或直接依賴都可以),若不包含請參考:
展開查看添加protobuf依賴的具體操作
如果您的go mod檔案不包含protobuf依賴,請參考以下步驟添加:
在專案main.go檔案的
import中增加以下依賴:_ "google.golang.org/protobuf/proto" _ "google.golang.org/protobuf/runtime/protoimpl"執行以下命令,自動下載缺失依賴並同步到
vendor目錄。go mod tidy go mod vendor
編譯參數是否添加了
-mod=vendor,若未添加,在go build後添加-mod=vendor。
使用
wget命令下載編譯工具instgo,請根據編譯環境和編譯機器所在地區,選擇對應的下載地址。需要注意,instgo 在編譯時間會觸發自動更新,請將 instgo 儲存在編譯使用者具有修改許可權的目錄下。
說明Instgo 是 ARMS 提供的 Golang 應用編譯工具,使用 instgo 編譯您的 Golang 專案後,ARMS 即可開始監控您的 Golang 應用。
各地區下載的編譯工具是相同的,如果您的公網環境可以訪問OSS地址,可以直接使用對應作業系統和架構的杭州公網地址擷取編譯工具。
展開查看各地區對應的下載命令
Linux(AMD64)
地區
公網地址
VPC地址
華東1(杭州)
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華東2(上海)
wget "http://arms-apm-cn-shanghai.oss-cn-shanghai.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華北1(青島)
wget "http://arms-apm-cn-qingdao.oss-cn-qingdao.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華北2(北京)
wget "http://arms-apm-cn-beijing.oss-cn-beijing.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華北3(張家口)
wget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華北5(呼和浩特)
wget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華北6(烏蘭察布)
wget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華南1(深圳)
wget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華南2(河源)
wget "http://arms-apm-cn-heyuan.oss-cn-heyuan.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo華南3(廣州)
wget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo西南1(成都)
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo中國(香港)
wget "http://arms-apm-cn-hongkong.oss-cn-hongkong.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo新加坡
wget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo亞太地區東南3(吉隆坡)
wget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo亞太地區東南5(雅加達)
wget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo亞太地區東北1(東京)
wget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo歐洲中部1(法蘭克福)
wget "http://arms-apm-eu-central-1.oss-eu-central-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo歐洲西部1(倫敦)
wget "http://arms-apm-eu-west-1.oss-eu-west-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo美國東部1(維吉尼亞)
wget "http://arms-apm-us-east-1.oss-us-east-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-us-east-1.oss-us-east-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgo美國西部1(矽谷)
wget "http://arms-apm-us-west-1.oss-us-west-1.aliyuncs.com/instgo/instgo-linux-amd64" -O instgowget "http://arms-apm-us-west-1.oss-us-west-1-internal.aliyuncs.com/instgo/instgo-linux-amd64" -O instgoLinux(ARM64)
地區
公網地址
VPC地址
華東1(杭州)
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華東2(上海)
wget "http://arms-apm-cn-shanghai.oss-cn-shanghai.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華北1(青島)
wget "http://arms-apm-cn-qingdao.oss-cn-qingdao.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華北2(北京)
wget "http://arms-apm-cn-beijing.oss-cn-beijing.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華北3(張家口)
wget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華北5(呼和浩特)
wget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華北6(烏蘭察布)
wget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華南1(深圳)
wget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華南2(河源)
wget "http://arms-apm-cn-heyuan.oss-cn-heyuan.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo華南3(廣州)
wget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo西南1(成都)
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo中國(香港)
wget "http://arms-apm-cn-hongkong.oss-cn-hongkong.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo新加坡
wget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo亞太地區東南3(吉隆坡)
wget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo亞太地區東南5(雅加達)
wget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo亞太地區東北1(東京)
wget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo歐洲中部1(法蘭克福)
wget "http://arms-apm-eu-central-1.oss-eu-central-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo歐洲西部1(倫敦)
wget "http://arms-apm-eu-west-1.oss-eu-west-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo美國東部1(維吉尼亞)
wget "http://arms-apm-us-east-1.oss-us-east-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-us-east-1.oss-us-east-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo美國西部1(矽谷)
wget "http://arms-apm-us-west-1.oss-us-west-1.aliyuncs.com/instgo/instgo-linux-arm64" -O instgowget "http://arms-apm-us-west-1.oss-us-west-1-internal.aliyuncs.com/instgo/instgo-linux-arm64" -O instgoMac(ARM64)
地區
公網地址
VPC地址
華東1(杭州)
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華東2(上海)
wget "http://arms-apm-cn-shanghai.oss-cn-shanghai.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華北1(青島)
wget "http://arms-apm-cn-qingdao.oss-cn-qingdao.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華北2(北京)
wget "http://arms-apm-cn-beijing.oss-cn-beijing.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華北3(張家口)
wget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華北5(呼和浩特)
wget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華北6(烏蘭察布)
wget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華南1(深圳)
wget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華南2(河源)
wget "http://arms-apm-cn-heyuan.oss-cn-heyuan.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo華南3(廣州)
wget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo西南1(成都)
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo中國(香港)
wget "http://arms-apm-cn-hongkong.oss-cn-hongkong.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo新加坡
wget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo亞太地區東南3(吉隆坡)
wget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo亞太地區東南5(雅加達)
wget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo亞太地區東北1(東京)
wget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo歐洲中部1(法蘭克福)
wget "http://arms-apm-eu-central-1.oss-eu-central-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo歐洲西部1(倫敦)
wget "http://arms-apm-eu-west-1.oss-eu-west-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo美國東部1(維吉尼亞)
wget "http://arms-apm-us-east-1.oss-us-east-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-us-east-1.oss-us-east-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgo美國西部1(矽谷)
wget "http://arms-apm-us-west-1.oss-us-west-1.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgowget "http://arms-apm-us-west-1.oss-us-west-1-internal.aliyuncs.com/instgo/instgo-darwin-arm64" -O instgoMac(AMD64)
地區
公網地址
VPC地址
華東1(杭州)
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華東2(上海)
wget "http://arms-apm-cn-shanghai.oss-cn-shanghai.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華北1(青島)
wget "http://arms-apm-cn-qingdao.oss-cn-qingdao.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華北2(北京)
wget "http://arms-apm-cn-beijing.oss-cn-beijing.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華北3(張家口)
wget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華北5(呼和浩特)
wget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華北6(烏蘭察布)
wget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華南1(深圳)
wget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華南2(河源)
wget "http://arms-apm-cn-heyuan.oss-cn-heyuan.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo華南3(廣州)
wget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo西南1(成都)
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo中國(香港)
wget "http://arms-apm-cn-hongkong.oss-cn-hongkong.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo新加坡
wget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo亞太地區東南3(吉隆坡)
wget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo亞太地區東南5(雅加達)
wget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo亞太地區東北1(東京)
wget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo歐洲中部1(法蘭克福)
wget "http://arms-apm-eu-central-1.oss-eu-central-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo歐洲西部1(倫敦)
wget "http://arms-apm-eu-west-1.oss-eu-west-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo美國東部1(維吉尼亞)
wget "http://arms-apm-us-east-1.oss-us-east-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-us-east-1.oss-us-east-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgo美國西部1(矽谷)
wget "http://arms-apm-us-west-1.oss-us-west-1.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgowget "http://arms-apm-us-west-1.oss-us-west-1-internal.aliyuncs.com/instgo/instgo-darwin-amd64" -O instgoWindows(AMD64)
地區
公網地址
VPC地址
華東1(杭州)
wget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華東2(上海)
wget "http://arms-apm-cn-shanghai.oss-cn-shanghai.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華北1(青島)
wget "http://arms-apm-cn-qingdao.oss-cn-qingdao.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華北2(北京)
wget "http://arms-apm-cn-beijing.oss-cn-beijing.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華北3(張家口)
wget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華北5(呼和浩特)
wget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華北6(烏蘭察布)
wget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華南1(深圳)
wget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華南2(河源)
wget "http://arms-apm-cn-heyuan.oss-cn-heyuan.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe華南3(廣州)
wget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe西南1(成都)
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe中國(香港)
wget "http://arms-apm-cn-hongkong.oss-cn-hongkong.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe新加坡
wget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe亞太地區東南3(吉隆坡)
wget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe亞太地區東南5(雅加達)
wget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe亞太地區東北1(東京)
wget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe歐洲中部1(法蘭克福)
wget "http://arms-apm-eu-central-1.oss-eu-central-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe歐洲西部1(倫敦)
wget "http://arms-apm-eu-west-1.oss-eu-west-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe美國東部1(維吉尼亞)
wget "http://arms-apm-us-east-1.oss-us-east-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-us-east-1.oss-us-east-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe美國西部1(矽谷)
wget "http://arms-apm-us-west-1.oss-us-west-1.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exewget "http://arms-apm-us-west-1.oss-us-west-1-internal.aliyuncs.com/instgo/instgo-windows-amd64.exe" -O instgo.exe為編譯工具賦予可執行許可權。
Linux/Mac
# 賦予可執行許可權 chmod +x instgoWindows
Windows中無需賦予可執行許可權。
擷取LicenseKey並配置編譯參數。
重要如果您跳過該步,instgo會進入dev模式,並預設為您安裝最新版本的ARMS探針。如果您需要在生產環境中部署,建議配置以下參數。
您可以通過DescribeTraceLicenseKey OpenAPI擷取LicenseKey。
在DescribeTraceLicenseKey文檔頁面單擊調試,選擇地區後單擊發起調用即可擷取LicenseKey。

擷取LicenseKey後使用
set命令配置編譯參數。instgo set --licenseKey=${YourLicenseKey}
將instgo作為首碼添加到您原有的編譯命令前並執行編譯。
instgo go build {arg1} {arg2} {arg3}如果您使用go install編譯專案,也可以直接將instgo作為首碼添加到您原有的編譯命令前並執行編譯。
使用上一步編譯的二進位檔案構建鏡像。
步驟二:配置環境變數
混合編譯後,您需要手動為Go應用添加以下環境變數:
export ARMS_ENABLE=true export ARMS_APP_NAME=xxx # 應用程式名稱。 export ARMS_REGION_ID=xxx # 對應的阿里雲帳號的RegionID。 export ARMS_LICENSE_KEY=xxx # 步驟一擷取到的LicenseKey。說明若希望預設通過公網上報資料,可聲明環境變數
ARMS_NETWORK_STRATEGY=public。除了通過export暴露環境變數外,您也可以在編譯時間通過ldflags指定相關的環境變數。
請將
module替換為go mod中配置的module名稱,其他參數參考環境變數。instgo go build -ldflags " -X 'github.com/alibaba/loongsuite-go-agent/pkg/exporters.ArmsApmName=${appName}' -X 'github.com/alibaba/loongsuite-go-agent/pkg/exporters.ArmsEnable=true' -X 'github.com/alibaba/loongsuite-go-agent/pkg/exporters.LicenseKey=${licenseKey}' -X 'github.com/alibaba/loongsuite-go-agent/pkg/exporters.RegionId=${regionId}'"
(可選)Docker環境安裝參考
對於Docker環境,可以參考以下Dockerfile樣本修改您的Dockerfile檔案。
### .....
ENV ARMS_ENABLE=true
ENV ARMS_APP_NAME={AppName}
ENV ARMS_REGION_ID={regionId}
ENV ARMS_LICENSE_KEY={licenseKey}
### 在下方添加自訂Dockerfile邏輯。
### ......結果驗證
約一分鐘後,若Golang應用出現在ARMS控制台的應用監控 > 應用列表頁面中且有資料上報,則說明接入成功。
