From 3e23fcae73d976e97603fbd4c0a58f50386a5ccc Mon Sep 17 00:00:00 2001 From: Jongwoo Han Date: Wed, 7 Jan 2026 14:56:02 +0900 Subject: [PATCH 1/3] Switch version from function to string in otelaws Signed-off-by: Jongwoo Han --- CHANGELOG.md | 4 ++++ instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go | 2 +- .../github.com/aws/aws-sdk-go-v2/otelaws/version.go | 5 +---- .../github.com/aws/aws-sdk-go-v2/otelaws/version_test.go | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0635d4bd5bb..bb93d8ecd2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Changed + +- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` has been replaced by `const Version`. (#8356) + ### Added - Change `Version()` function in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` to a `const Version` string. (#8142) diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go index d0d5aaed8b9..c901d340000 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go @@ -157,7 +157,7 @@ func AppendMiddlewares(apiOptions *[]func(*middleware.Stack) error, opts ...Opti m := otelMiddlewares{ tracer: cfg.TracerProvider.Tracer(ScopeName, - trace.WithInstrumentationVersion(Version())), + trace.WithInstrumentationVersion(Version), propagator: cfg.TextMapPropagator, attributeBuilders: cfg.AttributeBuilders, } diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version.go index 6ca152e2b93..b0c5a9a6fdf 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version.go @@ -4,7 +4,4 @@ package otelaws // import "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws" // Version is the current release version of the AWS SDKv2 instrumentation. -func Version() string { - return "0.64.0" - // This string is updated by the pre_release.sh script during release -} +const Version = "0.64.0" diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version_test.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version_test.go index af6fae28487..31b7d9cfc2c 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version_test.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/version_test.go @@ -19,6 +19,6 @@ var versionRegex = regexp.MustCompile(`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*) `(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`) func TestVersionSemver(t *testing.T) { - v := otelaws.Version() + v := otelaws.Version assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v) } From 4ce808a2d279afc006ad17674ac11889a5da674f Mon Sep 17 00:00:00 2001 From: Jongwoo Han Date: Wed, 7 Jan 2026 17:30:19 +0900 Subject: [PATCH 2/3] Fix changelog for #8356 --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb93d8ecd2c..ccd13dd605e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] -### Changed - -- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` has been replaced by `const Version`. (#8356) - ### Added - Change `Version()` function in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` to a `const Version` string. (#8142) @@ -34,6 +30,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed - The `Version()` function in `go.opentelemetry.io/contrib/zpages` has been replaced by `const Version`. (#8325) +- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` has been replaced by `const Version`. (#8356) From ee1c94f6eb07114c12947ae4eb47568140e03871 Mon Sep 17 00:00:00 2001 From: Jongwoo Han Date: Wed, 7 Jan 2026 17:38:45 +0900 Subject: [PATCH 3/3] Fix missing parentheses --- instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go index c901d340000..918c18a16b2 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go @@ -157,7 +157,7 @@ func AppendMiddlewares(apiOptions *[]func(*middleware.Stack) error, opts ...Opti m := otelMiddlewares{ tracer: cfg.TracerProvider.Tracer(ScopeName, - trace.WithInstrumentationVersion(Version), + trace.WithInstrumentationVersion(Version)), propagator: cfg.TextMapPropagator, attributeBuilders: cfg.AttributeBuilders, }