diff --git a/CHANGELOG.md b/CHANGELOG.md index dec28bfc983..e60f013244c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,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-lambda-go/otellambda` has been replaced by `const Version`. (#8357) - The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` has been replaced by `const Version`. (#8356) - The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful` has been replaced by `const Version`. (#8360) - The `Version()` function in `go.opentelemetry.io/contrib/propagators/opencensus` has been replaced by `const Version`. (#8361) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go index 0d3e784b968..39fe9628c5f 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go @@ -43,7 +43,7 @@ func newInstrumentor(opts ...Option) instrumentor { return instrumentor{ configuration: cfg, - tracer: cfg.TracerProvider.Tracer(ScopeName, trace.WithInstrumentationVersion(Version())), + tracer: cfg.TracerProvider.Tracer(ScopeName, trace.WithInstrumentationVersion(Version)), resAttrs: []attribute.KeyValue{}, } } diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambdatest_test.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambdatest_test.go index a865b5b3ca8..8f9a146c05d 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambdatest_test.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambdatest_test.go @@ -147,7 +147,7 @@ var ( attribute.Int("faas.max_memory", 128*miB)), InstrumentationScope: instrumentation.Scope{ Name: "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda", - Version: otellambda.Version(), + Version: otellambda.Version, }, } ) @@ -342,7 +342,7 @@ var ( attribute.Int("faas.max_memory", 128*miB)), InstrumentationScope: instrumentation.Scope{ Name: "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda", - Version: otellambda.Version(), + Version: otellambda.Version, }, } ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/version.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/version.go index bfdd587e375..7e943aeca62 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/version.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/version.go @@ -4,7 +4,4 @@ package otellambda // import "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda" // Version is the current release version of the AWS Lambda 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-lambda-go/otellambda/version_test.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/version_test.go index 76125ac844a..1ce37cf9599 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/version_test.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/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 := otellambda.Version() + v := otellambda.Version assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v) } diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/xrayconfig_test.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/xrayconfig_test.go index d9e31069b6f..c2bc598866e 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/xrayconfig_test.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/xrayconfig_test.go @@ -79,7 +79,7 @@ var ( }) expectedSpans = v1trace.ScopeSpans{ - Scope: &v1common.InstrumentationScope{Name: "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda", Version: otellambda.Version()}, + Scope: &v1common.InstrumentationScope{Name: "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda", Version: otellambda.Version}, Spans: []*v1trace.Span{{ TraceId: []byte{0x57, 0x59, 0xe9, 0x88, 0xbd, 0x86, 0x2e, 0x3f, 0xe1, 0xbe, 0x46, 0xa9, 0x94, 0x27, 0x27, 0x93}, SpanId: nil,