Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[component] Remove host.ReportFatalError #9506

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/remove_ReportFatalError.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: component

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove `host.ReportFatalError`

# One or more tracking issues or pull requests related to the change
issues: [6344]

# (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]
2 changes: 0 additions & 2 deletions component/componenttest/nop_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ func NewNopHost() component.Host {
return &nopHost{}
}

func (nh *nopHost) ReportFatalError(_ error) {}

func (nh *nopHost) GetFactory(_ component.Kind, _ component.Type) component.Factory {
return nil
}
Expand Down
2 changes: 0 additions & 2 deletions component/componenttest/nop_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package componenttest

import (
"errors"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -18,7 +17,6 @@ func TestNewNopHost(t *testing.T) {
require.NotNil(t, nh)
require.IsType(t, &nopHost{}, nh)

nh.ReportFatalError(errors.New("TestError"))
assert.Nil(t, nh.GetExporters()) // nolint: staticcheck
assert.Nil(t, nh.GetExtensions())
assert.Nil(t, nh.GetFactory(component.KindReceiver, component.MustNewType("test")))
Expand Down
10 changes: 0 additions & 10 deletions component/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ package component // import "go.opentelemetry.io/collector/component"
// Host represents the entity that is hosting a Component. It is used to allow communication
// between the Component and its host (normally the service.Collector is the host).
type Host interface {
// ReportFatalError is used to report to the host that the component
// encountered a fatal error (i.e.: an error that the instance can't recover
// from) after its start function had already returned.
//
// ReportFatalError should be called by the component anytime after Component.Start() ends and
// before Component.Shutdown() begins.
// Deprecated: [0.87.0] Use TelemetrySettings.ReportComponentStatus instead (with an event
// component.StatusFatalError)
ReportFatalError(err error)

// GetFactory of the specified kind. Returns the factory for a component type.
// This allows components to create other components. For example:
// func (r MyReceiver) Start(host component.Host) error {
Expand Down
7 changes: 0 additions & 7 deletions service/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ type serviceHost struct {
serviceExtensions *extensions.Extensions
}

// ReportFatalError is used to report to the host that the receiver encountered
// a fatal error (i.e.: an error that the instance can't recover from) after
// its start function has already returned.
// Deprecated: [0.87.0] Replaced by servicetelemetry.Settings.ReportComponentStatus
func (host *serviceHost) ReportFatalError(err error) {
host.asyncErrorChannel <- err
}
func (host *serviceHost) GetFactory(kind component.Kind, componentType component.Type) component.Factory {
switch kind {
case component.KindReceiver:
Expand Down
Loading