View Go Application Compilation Information
First, locate the Go application path: ps -ef | grep <process-keyword>
If the Go application path in the ps result is not a full path, use readlink -f /proc/[pid]/exe to view the complete path.
Use ls <Go-application-path> to check if the path exists. If not, it means the application is running inside a container, and the path is /proc/[pid]/root/<Go-application-path>
Download Analysis Tool
Then extract it. The package contains files for both amd64 and arm64 CPU architectures.
wget https://wukongdoc.tingyun.com/apm/deploy/Go/image/parser.tar.gz
tar -xzf parser.tar.gz
Run the Analysis Tool
Select the parser that matches your host's CPU architecture, run the parser, and output the analysis result:
./parser-amd64 <Go-application-path>
Example:
[nb@bogon tmp]$ ./parser-amd64 /opt/bin/watchdog
statically linked.
ELF Type: ET_EXEC
Version: 1
Machine: EM_X86_64
go version:
go1.22.10
go modules:
path watchdog
mod watchdog (devel)
dep github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
dep github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
dep github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
dep go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
dep go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
dep golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
dep gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
dep gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
build -buildmode=exe
build -compiler=gc
build -ldflags="-s -w"
build DefaultGODEBUG=httplaxcontentlength=1,httpmuxgo121=1,netedns0=0,panicnil=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
build CGO_ENABLED=0
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v1
build vcs=git
build vcs.revision=eea4e683f82259bcefeee374141508b7fbf3b032
build vcs.time=2025-02-11T10:13:41Z
build vcs.modified=true
Among them: statically linked means the application is statically linked; EM_X86_64 means the application's CPU architecture is amd64.
View Go Agent Logs
| Log Name | Purpose |
|---|---|
| logs/oneagent/preload.log | Logs for automatic identification of Go processes |
| logs/agent/golang_bootstrap.log | Records Go version, compilation options, etc. |
| logs/agent/golang_agent.log | Records agent runtime status |
| logs/agent/golang_daemon.log | Communication with Collector, data upload logs |
No Go Application Data Reported: Troubleshooting Ideas
Step 1. Check Agent Version
cat /opt/tingyun-oneagent/Version
Check if it is greater than or equal to 2.5.8.0. Lower versions do not support automatic injection for Go applications.
Step 2. Check System CPU Architecture
uname -m
Currently, ARM64 architecture Linux is not supported.
Step 3. Check for Injected Process
ps -ef | grep <Go-application-name>
Check if the result contains agentinject. If not, the Go Agent automatic injection failed.
After successful automatic injection, you should see output similar to:
[nb@bogon]$ ps -ef | grep simple-go-1.23-static
nb 956856 695456 00:00:00 /opt/tingyun-oneagent/agent/go_4.0.2/bin/agentinject ./simple-go-1.23-static
nb 956858 1 00:00:00 ./simple-go-1.23-static
Step 4. Automatic Injection Failed: Check Instrumentation Switch
UniAgent Linux:
-
Check if
go_enabledis enabled in/opt/tingyun-oneagent/conf/interceptor.conf, and ifgo.namelistmatches the Go application name. -
Check preload.log in 'logs/oneagent/' for
go Name Matchedrecords to confirm if the application name matches.
UniAgent Kubernetes:
- No need to check.
Step 5. Automatic Injection Failed: Check Go Application Compilation Version
Use the parser tool to check the Go version used to compile the application.
Currently supported Go versions: Go 1.17 - Go 1.23
If there is a go Name Matched record in preload.log, but the Go version does not match, golang_bootstrap.log will contain:
(pid:1031606,uid:1000) ERROR [load]: Go Version unsupported, skip
Step 6. Automatic Injection Failed: Check Permissions When Running Go Application in Docker
When running the Go Agent inside a Docker container, if golang_bootstrap.log contains Operation not permitted:
ERROR [inject] Process 9 vm read(0x6a55c0, -1) error -> Operation not permitted
Reason: The agent requires SYS_PTRACE permission during loading.
Solution: Add the --cap-add=SYS_PTRACE parameter when running the container.
Example:
docker run --cap-add=SYS_PTRACE demo_image
If still restricted, try adding --security-opt seccomp=unconfined or a custom seccomp configuration.
Step 7. Automatic Injection Succeeded: Check Communication Logs
Check logs/agent/golang_agent.log to confirm if communication with the intermediate process is normal. If you see Connect file:///opt/tingyun-oneagent/agent/go_version/run/goagent.sock failed, it means communication with the intermediate process failed, possibly due to not restarting the UniAgent service.
Check logs/agent/golang_daemon.log to confirm if communication with the collector is normal.
The agent only supports monitoring requests for HTTP frameworks and gRPC frameworks, and does not support monitoring for custom frameworks.
Other Issues
- The Go Agent supports a maximum concurrency of 65536 by default. If a single application process handles more than 65536 requests simultaneously, in Go 1.21 and above, trace data exceeding the concurrency limit will be discarded; in Go 1.20 and below, this will cause a panic in the goroutine.