kv-go-instrumentation logs error and exits, error message are as below:
{"level":"info","ts":1667322994.3850787,"caller":"cli/main.go:22","msg":"starting Go OpenTelemetry Agent ..."}
{"level":"info","ts":1667322994.385147,"caller":"opentelemetry/controller.go:92","msg":"Establishing connection to OpenTelemetry collector ..."}
{"level":"info","ts":1667322996.387433,"caller":"process/discover.go:42","msg":"found process","pid":19}
{"level":"info","ts":1667322996.3889744,"caller":"process/analyze.go:73","msg":"found addr of keyval map","addr":140331000791040}
{"level":"error","ts":1667322996.3974175,"caller":"cli/main.go:61","msg":"error while analyzing target process","error":".gosymtab section not found in target binary, make sure this is a Go application","stacktrace":"main.main\n\t/app/cli/main.go:61\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
operation-system/kernel version:
Output of awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release:Output of uname -r:
"CentOS Linux 7 (Core)"
5.16.11-1.el7.elrepo.x86_64
sec := elfF.Section(".gosymtab")
if sec == nil {
return nil, fmt.Errorf("%s section not found in target binary, make sure this is a Go application", ".gosymtab")
}
Expected Behavior
When a go binary file doesn't contain ".gosymtab" section, it should be able to instrument it.
Actual Behavior
Analyze process stops when it can't find ".gosymtab" section in target go binary file.
Steps to Reproduce the Problem
awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release
: Output ofuname -r
:The corresponding source code is from: https://github.com/keyval-dev/opentelemetry-go-instrumentation/blob/master/pkg/process/analyze.go line 117 to 120: