diff --git a/.chloggen/GetExportersWithSignal.yaml b/.chloggen/GetExportersWithSignal.yaml new file mode 100644 index 00000000000..0dcd58c4c13 --- /dev/null +++ b/.chloggen/GetExportersWithSignal.yaml @@ -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: service + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Change Host to not implement GetExportersWithSignal + +# One or more tracking issues or pull requests related to the change +issues: [11444] + +# (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: Use Host.GetExporters if still needed. + +# 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] diff --git a/service/internal/graph/host.go b/service/internal/graph/host.go index ee245cd0209..6463eaad531 100644 --- a/service/internal/graph/host.go +++ b/service/internal/graph/host.go @@ -27,15 +27,7 @@ type getExporters interface { GetExporters() map[pipeline.Signal]map[component.ID]component.Component } -// TODO: remove as part of https://github.com/open-telemetry/opentelemetry-collector/issues/7370 for service 1.0 -// -// nolint -type getExportersWithSignal interface { - GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component -} - var _ getExporters = (*Host)(nil) -var _ getExportersWithSignal = (*Host)(nil) var _ component.Host = (*Host)(nil) type Host struct { @@ -85,17 +77,6 @@ func (host *Host) GetExporters() map[pipeline.Signal]map[component.ID]component. return host.Pipelines.GetExporters() } -// Deprecated: [0.79.0] This function will be removed in the future. -// Several components in the contrib repository use this function so it cannot be removed -// before those cases are removed. In most cases, use of this function can be replaced by a -// connector. See https://github.com/open-telemetry/opentelemetry-collector/issues/7370 and -// https://github.com/open-telemetry/opentelemetry-collector/pull/7390#issuecomment-1483710184 -// for additional information. -// If you still need this, use GetExporters instead. -func (host *Host) GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component { - return host.Pipelines.GetExporters() -} - func (host *Host) NotifyComponentStatusChange(source *componentstatus.InstanceID, event *componentstatus.Event) { host.ServiceExtensions.NotifyComponentStatusChange(source, event) if event.Status() == componentstatus.StatusFatalError { diff --git a/service/service_test.go b/service/service_test.go index 09aa0b7a4ab..d1663a8212e 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -246,33 +246,6 @@ func TestServiceGetExporters(t *testing.T) { assert.Contains(t, expMap[pipelineprofiles.SignalProfiles], component.NewID(nopType)) } -func TestServiceGetExportersWithSignal(t *testing.T) { - srv, err := New(context.Background(), newNopSettings(), newNopConfig()) - require.NoError(t, err) - - assert.NoError(t, srv.Start(context.Background())) - t.Cleanup(func() { - assert.NoError(t, srv.Shutdown(context.Background())) - }) - - // nolint - expMap := srv.host.GetExportersWithSignal() - - v, ok := expMap[pipeline.SignalTraces] - assert.True(t, ok) - assert.NotNil(t, v) - - assert.Len(t, expMap, 4) - assert.Len(t, expMap[pipeline.SignalTraces], 1) - assert.Contains(t, expMap[pipeline.SignalTraces], component.NewID(nopType)) - assert.Len(t, expMap[pipeline.SignalMetrics], 1) - assert.Contains(t, expMap[pipeline.SignalMetrics], component.NewID(nopType)) - assert.Len(t, expMap[pipeline.SignalLogs], 1) - assert.Contains(t, expMap[pipeline.SignalLogs], component.NewID(nopType)) - assert.Len(t, expMap[pipelineprofiles.SignalProfiles], 1) - assert.Contains(t, expMap[pipelineprofiles.SignalProfiles], component.NewID(nopType)) -} - // TestServiceTelemetryCleanupOnError tests that if newService errors due to an invalid config telemetry is cleaned up // and another service with a valid config can be started right after. func TestServiceTelemetryCleanupOnError(t *testing.T) {