When a go binary file doesn't contain ".gosymtab" section, it should be able to instrument it.
Analyze process stops when it can't find ".gosymtab" section in target go binary file.
OTEL_SERVICE_NAME=goapp OTEL_TARGET_EXE=/goapp OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 /kv-go-instrumentation
{"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"}
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
Output of
awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release:Output of
uname -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: