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

Deprecate and add warning to remove AtomicFieldOffsets, unnecessary public func #2445

Merged
merged 2 commits into from Dec 15, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Deprecate module `"go.opentelemetry.io/otel/sdk/export/metric"`, new functionality available in "go.opentelemetry.io/otel/sdk/metric" module:
- Import path changed `import "go.opentelemetry.io/otel/sdk/export/metric"` to `import go.opentelemetry.io/otel/sdk/metric/export` (#2382).
- Deprecate `AtomicFieldOffsets`, unnecessary public func (#2445)

## [1.3.0] - 2021-12-10

Expand Down
6 changes: 5 additions & 1 deletion sdk/metric/alignment_test.go
Expand Up @@ -17,13 +17,17 @@ package metric
import (
"os"
"testing"
"unsafe"

ottest "go.opentelemetry.io/otel/internal/internaltest"
)

// Ensure struct alignment prior to running tests.
func TestMain(m *testing.M) {
offsets := AtomicFieldOffsets()
offsets := map[string]uintptr{
"record.refMapped.value": unsafe.Offsetof(record{}.refMapped.value),
"record.updateCount": unsafe.Offsetof(record{}.updateCount),
}
var r []ottest.FieldOffset
for name, offset := range offsets {
r = append(r, ottest.FieldOffset{
Expand Down
1 change: 1 addition & 0 deletions sdk/metric/atomicfields.go
Expand Up @@ -16,6 +16,7 @@ package metric // import "go.opentelemetry.io/otel/sdk/metric"

import "unsafe"

// Deprecated: will be removed soon.
func AtomicFieldOffsets() map[string]uintptr {
return map[string]uintptr{
"record.refMapped.value": unsafe.Offsetof(record{}.refMapped.value),
Expand Down