Skip to content

Commit

Permalink
Remove deprecated func NewUnhealthyProcessorCreateSettings (open-tele…
Browse files Browse the repository at this point in the history
…metry#11665)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Nov 13, 2024
1 parent 18090a7 commit 1f93154
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
25 changes: 25 additions & 0 deletions .chloggen/rm-dep-processortest.yaml
Original file line number Diff line number Diff line change
@@ -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]
9 changes: 0 additions & 9 deletions processor/processortest/unhealthy_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions processor/processortest/unhealthy_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 1f93154

Please sign in to comment.