diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c5660aa35..b05fabb9159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `Version()` function in `go.opentelemetry.io/contrib/propagators/opencensus` has been replaced by `const Version`. (#8361) - The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho` has been replaced by `const Version`. (#8365) - The `Version()` function in `go.opentelemetry.io/contrib/samplers/probability/consistent` has been replaced by `const Version`. (#8366) +- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace` has been replaced by `const Version`. (#8302) - The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/v2/mongo/otelmongo` has been replaced by `const Version`. (#8370) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go index 452166214d1..7b624649160 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go @@ -165,7 +165,7 @@ func NewClientTrace(ctx context.Context, opts ...ClientTraceOption) *httptrace.C ct.tr = ct.tracerProvider.Tracer( ScopeName, - trace.WithInstrumentationVersion(Version()), + trace.WithInstrumentationVersion(Version), ) return &httptrace.ClientTrace{ diff --git a/instrumentation/net/http/httptrace/otelhttptrace/version.go b/instrumentation/net/http/httptrace/otelhttptrace/version.go index ba8a5df0edd..6fb3b626118 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/version.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/version.go @@ -4,7 +4,4 @@ package otelhttptrace // import "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace" // Version is the current release version of the httptrace 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/net/http/httptrace/otelhttptrace/version_test.go b/instrumentation/net/http/httptrace/otelhttptrace/version_test.go index ff87cdc0143..4b7b4524c0a 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/version_test.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/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 := otelhttptrace.Version() + v := otelhttptrace.Version assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v) }