Skip to content
Merged
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 @@ -16,6 +16,7 @@ The next release will require at least [Go 1.25].
- `WithSpanKind` option in `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` to override the default span kind. (#8506)
- Add `const Version` in `go.opentelemetry.io/contrib/bridges/otelzap`. (#8544)
- Support testing of [Go 1.26]. (#8549)
- Add `const Version` in `go.opentelemetry.io/contrib/detectors/autodetect`. (#8555)
- Add `const Version` in `go.opentelemetry.io/contrib/detectors/azure/azurevm`. (#8553)
- Add `const Version` in `go.opentelemetry.io/contrib/processors/baggagecopy`. (#8557)
- Add `const Version` in `go.opentelemetry.io/contrib/detectors/aws/lambda`. (#8510)
Expand Down
3 changes: 3 additions & 0 deletions detectors/autodetect/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module go.opentelemetry.io/contrib/detectors/autodetect
go 1.24.0

require (
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/contrib/detectors/aws/ec2/v2 v2.2.0
go.opentelemetry.io/contrib/detectors/aws/ecs v1.40.0
go.opentelemetry.io/contrib/detectors/aws/eks v1.40.0
Expand Down Expand Up @@ -58,6 +59,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
Expand All @@ -73,6 +75,7 @@ require (
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.34.3 // indirect
k8s.io/apimachinery v0.34.3 // indirect
k8s.io/client-go v0.34.3 // indirect
Expand Down
7 changes: 7 additions & 0 deletions detectors/autodetect/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package autodetect // import "go.opentelemetry.io/contrib/detectors/autodetect"

// Version is the current release version of the autodetect detector.
const Version = "0.12.0"
24 changes: 24 additions & 0 deletions detectors/autodetect/version_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package autodetect_test

import (
"regexp"
"testing"

"github.com/stretchr/testify/assert"

"go.opentelemetry.io/contrib/detectors/autodetect"
)

// regex taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
var versionRegex = regexp.MustCompile(`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)` +
`(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)` +
`(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` +
`(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)

func TestVersionSemver(t *testing.T) {
v := autodetect.Version
assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v)
}
Loading