Deprecate component.Host.GetExporters (#7390)
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
This commit is contained in:
parent
87dd85a6c0
commit
fe2ae8defc
|
|
@ -0,0 +1,16 @@
|
|||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
|
||||
change_type: deprecation
|
||||
|
||||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
|
||||
component: component
|
||||
|
||||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
|
||||
note: Deprecate Host.GetExporters function
|
||||
|
||||
# One or more tracking issues or pull requests related to the change
|
||||
issues: [7370]
|
||||
|
||||
# (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:
|
||||
|
|
@ -19,7 +19,7 @@ func TestNewNopHost(t *testing.T) {
|
|||
require.IsType(t, &nopHost{}, nh)
|
||||
|
||||
nh.ReportFatalError(errors.New("TestError"))
|
||||
assert.Nil(t, nh.GetExporters())
|
||||
assert.Nil(t, nh.GetExporters()) // nolint: staticcheck
|
||||
assert.Nil(t, nh.GetExtensions())
|
||||
assert.Nil(t, nh.GetFactory(component.KindReceiver, "test"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,5 +47,12 @@ type Host interface {
|
|||
//
|
||||
// GetExporters can be called by the component anytime after Component.Start() begins and
|
||||
// until Component.Shutdown() ends.
|
||||
//
|
||||
// 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.
|
||||
GetExporters() map[DataType]map[ID]Component
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,12 @@ func (host *serviceHost) GetExtensions() map[component.ID]component.Component {
|
|||
return host.serviceExtensions.GetExtensions()
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (host *serviceHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
|
||||
return host.pipelines.GetExporters()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,6 +310,12 @@ func (g *Graph) ShutdownAll(ctx context.Context) error {
|
|||
return errs
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (g *Graph) GetExporters() map[component.DataType]map[component.ID]component.Component {
|
||||
exportersMap := make(map[component.DataType]map[component.ID]component.Component)
|
||||
exportersMap[component.DataTypeTraces] = make(map[component.ID]component.Component)
|
||||
|
|
|
|||
Loading…
Reference in New Issue