Remove deprecated func NewUnhealthyProcessorCreateSettings (#11665)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
Bogdan Drutu 2024-11-12 16:05:09 -08:00 committed by GitHub
parent 18090a763f
commit 1f93154bed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 12 deletions

View File

@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: processortest
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated func NewUnhealthyProcessorCreateSettings
# One or more tracking issues or pull requests related to the change
issues: [11665]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]

View File

@ -8,20 +8,11 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componentstatus"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/processor"
)
// Deprecated: [v0.112.0] not used. To be removed. Use NewNopSettings instead.
func NewUnhealthyProcessorCreateSettings() processor.Settings {
return processor.Settings{
TelemetrySettings: componenttest.NewNopTelemetrySettings(),
BuildInfo: component.NewDefaultBuildInfo(),
}
}
// NewUnhealthyProcessorFactory returns a processor.Factory that constructs nop processors.
func NewUnhealthyProcessorFactory() processor.Factory {
return processor.NewFactory(

View File

@ -26,21 +26,21 @@ func TestNewUnhealthyProcessorFactory(t *testing.T) {
cfg := factory.CreateDefaultConfig()
assert.Equal(t, &struct{}{}, cfg)
traces, err := factory.CreateTraces(context.Background(), NewUnhealthyProcessorCreateSettings(), cfg, consumertest.NewNop())
traces, err := factory.CreateTraces(context.Background(), NewNopSettings(), cfg, consumertest.NewNop())
require.NoError(t, err)
assert.Equal(t, consumer.Capabilities{MutatesData: false}, traces.Capabilities())
assert.NoError(t, traces.Start(context.Background(), componenttest.NewNopHost()))
assert.NoError(t, traces.ConsumeTraces(context.Background(), ptrace.NewTraces()))
assert.NoError(t, traces.Shutdown(context.Background()))
metrics, err := factory.CreateMetrics(context.Background(), NewUnhealthyProcessorCreateSettings(), cfg, consumertest.NewNop())
metrics, err := factory.CreateMetrics(context.Background(), NewNopSettings(), cfg, consumertest.NewNop())
require.NoError(t, err)
assert.Equal(t, consumer.Capabilities{MutatesData: false}, metrics.Capabilities())
assert.NoError(t, metrics.Start(context.Background(), componenttest.NewNopHost()))
assert.NoError(t, metrics.ConsumeMetrics(context.Background(), pmetric.NewMetrics()))
assert.NoError(t, metrics.Shutdown(context.Background()))
logs, err := factory.CreateLogs(context.Background(), NewUnhealthyProcessorCreateSettings(), cfg, consumertest.NewNop())
logs, err := factory.CreateLogs(context.Background(), NewNopSettings(), cfg, consumertest.NewNop())
require.NoError(t, err)
assert.Equal(t, consumer.Capabilities{MutatesData: false}, logs.Capabilities())
assert.NoError(t, logs.Start(context.Background(), componenttest.NewNopHost()))