From dc4beee118fe037ec960040a4eeffbebd40fd1c8 Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Mon, 16 Oct 2023 18:12:06 +0900 Subject: [PATCH 1/2] internal/pkg/process: fix to trim GOEXPERIMENT suffix Signed-off-by: Koichi Shiraishi --- CHANGELOG.md | 3 +++ internal/pkg/process/module.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c459b19..62f062f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http ## [Unreleased] +### Fixed +- Parse Go versions that contain `GOEXPERIMENT` suffixes. ([#389](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/389)) + ## [v0.7.0-alpha] - 2023-10-15 ### Added diff --git a/internal/pkg/process/module.go b/internal/pkg/process/module.go index 067a9a222..8cf63ce3b 100644 --- a/internal/pkg/process/module.go +++ b/internal/pkg/process/module.go @@ -54,6 +54,10 @@ func (a *Analyzer) getModuleDetails(f *elf.File) (*version.Version, map[string]s func parseGoVersion(vers string) (*version.Version, error) { vers = strings.ReplaceAll(vers, "go", "") + // Trims GOEXPERIMENT version suffix if present. + if idx := strings.Index(vers, " X:"); idx > 0 { + vers = vers[:idx] + } return version.NewVersion(vers) } From c09944a7b147e218dfe03d68a44eaf15cfb69b0d Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 20 Oct 2023 07:20:56 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f062f73..8f51d6477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http ## [Unreleased] ### Fixed + - Parse Go versions that contain `GOEXPERIMENT` suffixes. ([#389](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/389)) ## [v0.7.0-alpha] - 2023-10-15