Skip to content

Commit 23a8a37

Browse files
committed
Deprecate unnecessary type StatusFunc
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 6f45408 commit 23a8a37

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.chloggen/depstatusfunc.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: 'deprecation'
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: component
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate unnecessary type StatusFunc
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [9146]
14+
15+
# Optional: The change log or logs in which this entry should be included.
16+
# e.g. '[user]' or '[user, api]'
17+
# Include 'user' if the change is relevant to end users.
18+
# Include 'api' if there is a change to a library API.
19+
# Default: '[user]'
20+
change_logs: [api]

component/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ func NewFatalErrorEvent(err error) *StatusEvent {
9898
return ev
9999
}
100100

101-
// StatusFunc is the expected type of ReportComponentStatus for component.TelemetrySettings
102-
type StatusFunc func(*StatusEvent) error
101+
// Deprecated: [v0.92.0] use directly func(*StatusEvent) error.
102+
type StatusFunc = func(*StatusEvent) error
103103

104104
// AggregateStatus will derive a status for the given input using the following rules in order:
105105
// 1. If all instances have the same status, there is nothing to aggregate, return it.

component/telemetry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type TelemetrySettings struct {
4545
// - Calling this method before component startup
4646
//
4747
// If the API is being used properly, these errors are safe to ignore.
48-
ReportComponentStatus StatusFunc
48+
ReportComponentStatus func(*StatusEvent) error
4949
}
5050

5151
// Deprecated: [0.91.0] Use TelemetrySettings directly

0 commit comments

Comments
 (0)