Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent map lookups in traceglobal probe when using Go >= 1.24 #1573

Merged
merged 5 commits into from
Jan 10, 2025
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http
- Support `golang.org/x/net` `0.34.0`. ([#1552](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/1552))
- Support `google.golang.org/grpc` `1.71.0-dev`. ([#1467](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/1467))

### Changed

- Preemptively drop support for the `traceglobal` probe when `Go >= 1.24` is used. ([#1573](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/1573))

## [v0.19.0-alpha] - 2024-12-05

### Added
Expand Down
4 changes: 4 additions & 0 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Supported versions of [`otel`]:

- `v0.14.0` to `v1.33.0`

**Note**: Versions of `go.opentelemetry.io/otel < v1.33.0` are not supported
when using Go >= `1.24`. See [this issue] for details.

[`otel`]: https://pkg.go.dev/go.opentelemetry.io/otel
[this issue]: https://github.com/open-telemetry/opentelemetry-go-instrumentation/issues/1318

## Instrumented Library Compatibility

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
// Minimum version of go.opentelemetry.io/otel that supports using the
// go.opentelemetry.io/auto/sdk in the global API.
minAutoSDK = "1.33.0"
minGoMaps = "1.24.0"
)

var (
Expand All @@ -56,6 +57,14 @@ var (
),
FailureMode: probe.FailureModeIgnore,
}
goWithoutSwissMaps = probe.PackageConstrainst{
Package: "std",
Constraints: version.MustConstraints(
version.NewConstraint(fmt.Sprintf("< %s", minGoMaps)),
),
// Warn in logs that this is not supported.
FailureMode: probe.FailureModeWarn,
}
)

// New returns a new [probe.Probe].
Expand Down Expand Up @@ -151,13 +160,15 @@ func New(logger *slog.Logger) probe.Probe {
ReturnProbe: "uprobe_Start_Returns",
PackageConstrainsts: []probe.PackageConstrainst{
otelWithoutAutoSDK,
goWithoutSwissMaps,
},
},
{
Sym: "go.opentelemetry.io/otel/internal/global.(*nonRecordingSpan).End",
EntryProbe: "uprobe_End",
PackageConstrainsts: []probe.PackageConstrainst{
otelWithoutAutoSDK,
goWithoutSwissMaps,
},
},
{
Expand All @@ -166,6 +177,7 @@ func New(logger *slog.Logger) probe.Probe {
FailureMode: probe.FailureModeIgnore,
PackageConstrainsts: []probe.PackageConstrainst{
otelWithoutAutoSDK,
goWithoutSwissMaps,
},
},
{
Expand All @@ -174,6 +186,7 @@ func New(logger *slog.Logger) probe.Probe {
FailureMode: probe.FailureModeIgnore,
PackageConstrainsts: []probe.PackageConstrainst{
otelWithoutAutoSDK,
goWithoutSwissMaps,
},
},
{
Expand All @@ -182,6 +195,7 @@ func New(logger *slog.Logger) probe.Probe {
FailureMode: probe.FailureModeIgnore,
PackageConstrainsts: []probe.PackageConstrainst{
otelWithoutAutoSDK,
goWithoutSwissMaps,
},
},
},
Expand Down
Loading