Remove `GetExporters` from component.Host (#9987)
**Description:** Remove the deprecated `GetExporters` function from `component.Host` **Link to tracking Issue:** <Issue number if applicable> Related to https://github.com/open-telemetry/opentelemetry-collector/issues/7370
This commit is contained in:
parent
256c7c3536
commit
6611edfa5a
|
|
@ -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: component
|
||||
|
||||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
|
||||
note: Removed deprecated function `GetExporters` from `component.Host` interface
|
||||
|
||||
# One or more tracking issues or pull requests related to the change
|
||||
issues: [9987]
|
||||
|
||||
# (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]
|
||||
|
|
@ -17,7 +17,6 @@ func TestNewNopHost(t *testing.T) {
|
|||
require.NotNil(t, nh)
|
||||
require.IsType(t, &nopHost{}, nh)
|
||||
|
||||
assert.Nil(t, nh.GetExporters()) // nolint: staticcheck
|
||||
assert.Nil(t, nh.GetExtensions())
|
||||
assert.Nil(t, nh.GetFactory(component.KindReceiver, component.MustNewType("test")))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,24 +27,4 @@ type Host interface {
|
|||
// GetExtensions can be called by the component anytime after Component.Start() begins and
|
||||
// until Component.Shutdown() ends.
|
||||
GetExtensions() map[ID]Component
|
||||
|
||||
// GetExporters returns the map of exporters. Only enabled and created exporters will be returned.
|
||||
// Typically is used to find exporters by type or by full config name. Both cases
|
||||
// can be done by iterating the returned map. There are typically very few exporters,
|
||||
// so there are no performance implications due to iteration.
|
||||
// This returns a map by DataType of maps by exporter configs to the exporter instance.
|
||||
// Note that an exporter with the same name may be attached to multiple pipelines and
|
||||
// thus we may have an instance of the exporter for multiple data types.
|
||||
// This is an experimental function that may change or even be removed completely.
|
||||
//
|
||||
// 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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@ import (
|
|||
"go.opentelemetry.io/collector/service/internal/graph"
|
||||
)
|
||||
|
||||
// TODO: remove as part of https://github.com/open-telemetry/opentelemetry-collector/issues/7370 for service 1.0
|
||||
type getExporters interface {
|
||||
GetExporters() map[component.DataType]map[component.ID]component.Component
|
||||
}
|
||||
|
||||
var _ getExporters = (*serviceHost)(nil)
|
||||
var _ component.Host = (*serviceHost)(nil)
|
||||
|
||||
type serviceHost struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue