diff --git a/.chloggen/depstatusfunc.yaml b/.chloggen/depstatusfunc.yaml new file mode 100755 index 00000000000..01c6f7a7318 --- /dev/null +++ b/.chloggen/depstatusfunc.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# 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 unnecessary type StatusFunc + +# One or more tracking issues or pull requests related to the change +issues: [9146] + +# 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/component/status.go b/component/status.go index 36a449edc12..8d0650b0751 100644 --- a/component/status.go +++ b/component/status.go @@ -98,8 +98,8 @@ func NewFatalErrorEvent(err error) *StatusEvent { return ev } -// StatusFunc is the expected type of ReportComponentStatus for component.TelemetrySettings -type StatusFunc func(*StatusEvent) error +// Deprecated: [v0.92.0] use directly func(*StatusEvent) error. +type StatusFunc = func(*StatusEvent) error // AggregateStatus will derive a status for the given input using the following rules in order: // 1. If all instances have the same status, there is nothing to aggregate, return it. diff --git a/component/telemetry.go b/component/telemetry.go index 1f4e011e7e5..d8b6b134c34 100644 --- a/component/telemetry.go +++ b/component/telemetry.go @@ -45,5 +45,5 @@ type TelemetrySettings struct { // - Calling this method before component startup // // If the API is being used properly, these errors are safe to ignore. - ReportComponentStatus StatusFunc + ReportComponentStatus func(*StatusEvent) error } diff --git a/service/internal/status/status.go b/service/internal/status/status.go index 7592f139bcf..c5a002808ce 100644 --- a/service/internal/status/status.go +++ b/service/internal/status/status.go @@ -159,7 +159,7 @@ func (r *Reporter) componentFSM(id *component.InstanceID) *fsm { func NewComponentStatusFunc( id *component.InstanceID, srvStatus ServiceStatusFunc, -) component.StatusFunc { +) func(*component.StatusEvent) error { return func(ev *component.StatusEvent) error { return srvStatus(id, ev) }