diff --git a/CHANGELOG.md b/CHANGELOG.md index d92180cef..2ca9c8e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Removed - Drop support for [Go 1.22]. (#6381, #6418) +- Remove `Resource` field from `EnabledParameters` in `go.opentelemetry.io/otel/sdk/log`. (#6494) ### Changed diff --git a/sdk/log/filter_processor.go b/sdk/log/filter_processor.go index 5b99a4a99..a39cad9e0 100644 --- a/sdk/log/filter_processor.go +++ b/sdk/log/filter_processor.go @@ -8,7 +8,6 @@ import ( "go.opentelemetry.io/otel/log" "go.opentelemetry.io/otel/sdk/instrumentation" - "go.opentelemetry.io/otel/sdk/resource" ) // FilterProcessor is a [Processor] that knows, and can identify, what [Record] @@ -56,7 +55,6 @@ type FilterProcessor interface { // EnabledParameters represents payload for [FilterProcessor]'s Enabled method. type EnabledParameters struct { - Resource resource.Resource InstrumentationScope instrumentation.Scope Severity log.Severity } diff --git a/sdk/log/logger.go b/sdk/log/logger.go index 6211d5d92..cd3580ec0 100644 --- a/sdk/log/logger.go +++ b/sdk/log/logger.go @@ -50,7 +50,6 @@ func (l *logger) Emit(ctx context.Context, r log.Record) { // returned if it can be positively verified that no Processor will process. func (l *logger) Enabled(ctx context.Context, param log.EnabledParameters) bool { p := EnabledParameters{ - Resource: *l.provider.resource, InstrumentationScope: l.instrumentationScope, Severity: param.Severity, } diff --git a/sdk/log/logger_test.go b/sdk/log/logger_test.go index cd1e11374..e3865e512 100644 --- a/sdk/log/logger_test.go +++ b/sdk/log/logger_test.go @@ -224,9 +224,6 @@ func TestLoggerEnabled(t *testing.T) { p1 := newFltrProcessor("1", true) p2WithDisabled := newFltrProcessor("2", false) - emptyResource := resource.Empty() - res := resource.NewSchemaless(attribute.String("key", "value")) - testCases := []struct { name string logger *logger @@ -247,12 +244,10 @@ func TestLoggerEnabled(t *testing.T) { logger: newLogger(NewLoggerProvider( WithProcessor(p0), WithProcessor(p1), - WithResource(res), ), instrumentation.Scope{Name: "scope"}), ctx: context.Background(), expected: true, expectedP0Params: []EnabledParameters{{ - Resource: *res, InstrumentationScope: instrumentation.Scope{Name: "scope"}, }}, expectedP1Params: nil, @@ -261,7 +256,6 @@ func TestLoggerEnabled(t *testing.T) { name: "WithDisabledProcessors", logger: newLogger(NewLoggerProvider( WithProcessor(p2WithDisabled), - WithResource(emptyResource), ), instrumentation.Scope{}), ctx: context.Background(), expected: false, @@ -272,7 +266,6 @@ func TestLoggerEnabled(t *testing.T) { logger: newLogger(NewLoggerProvider( WithProcessor(p2WithDisabled), WithProcessor(p0), - WithResource(emptyResource), ), instrumentation.Scope{}), ctx: context.Background(), expected: true, @@ -284,7 +277,6 @@ func TestLoggerEnabled(t *testing.T) { logger: newLogger(NewLoggerProvider( WithProcessor(p0), WithProcessor(p1), - WithResource(emptyResource), ), instrumentation.Scope{}), ctx: nil, expected: true,