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

Ensure exported struct in sdk/log are not comparable #5693

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- `Processor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` now accepts a pointer to `Record` instead of a value so that the record modifications done in a processor are propagated to subsequent registered processors. (#5636)
- `SimpleProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log` now returns `false` if the exporter is `nil`. (#5665)
- The `SimpleProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693)
- The `BatchProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693)

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions sdk/log/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ type BatchProcessor struct {

// stopped holds the stopped state of the BatchProcessor.
stopped atomic.Bool

noCmp [0]func() //nolint: unused // This is indeed used.
XSAM marked this conversation as resolved.
Show resolved Hide resolved
}

// NewBatchProcessor decorates the provided exporter
Expand Down
2 changes: 2 additions & 0 deletions sdk/log/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ type LoggerProvider struct {
loggers map[instrumentation.Scope]*logger

stopped atomic.Bool

noCmp [0]func() //nolint: unused // This is indeed used.
XSAM marked this conversation as resolved.
Show resolved Hide resolved
}

// Compile-time check LoggerProvider implements log.LoggerProvider.
Expand Down
2 changes: 2 additions & 0 deletions sdk/log/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ type Record struct {

attributeValueLengthLimit int
attributeCountLimit int

noCmp [0]func() //nolint: unused // This is indeed used.
XSAM marked this conversation as resolved.
Show resolved Hide resolved
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
}

func (r *Record) addDropped(n int) {
Expand Down
2 changes: 2 additions & 0 deletions sdk/log/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var _ Processor = (*SimpleProcessor)(nil)
// Use [NewSimpleProcessor] to create a SimpleProcessor.
type SimpleProcessor struct {
exporter Exporter

noCmp [0]func() //nolint: unused // This is indeed used.
XSAM marked this conversation as resolved.
Show resolved Hide resolved
}

// NewSimpleProcessor is a simple Processor adapter.
Expand Down