From f710cecfc545facd0bf84fe27e21de3ff6276fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 26 Sep 2024 08:32:36 +0200 Subject: [PATCH] log: Make Record not comparable (#5847) Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5696 --- CHANGELOG.md | 1 + log/record.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb6c251775..bb2f5962056 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Enable exemplars by default in `go.opentelemetry.io/otel/sdk/metric`. Exemplars can be disabled by setting `OTEL_METRICS_EXEMPLAR_FILTER=always_off` (#5778) - `Logger.Enabled` in `go.opentelemetry.io/otel/log` now accepts a newly introduced `EnabledParameters` type instead of `Record`. (#5791) - `FilterProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log/internal/x` now accepts `EnabledParameters` instead of `Record`. (#5791) +- The `Record` type in `go.opentelemetry.io/otel/log` is no longer comparable. (#5847) ### Fixed diff --git a/log/record.go b/log/record.go index 96302f00624..7cf5446a041 100644 --- a/log/record.go +++ b/log/record.go @@ -16,6 +16,9 @@ const attributesInlineCount = 5 // Record represents a log record. type Record struct { + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. + timestamp time.Time observedTimestamp time.Time severity Severity