Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed

- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace` has been replaced by `const Version`. (#8383)
- The `Version()` function in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` has been replaced by `const Version`. (#8142)
- 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/runtime` has been replaced by `const Version` string. (#8349)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}