Skip to content

Commit 2032c68

Browse files
committed
Remove deprecated funcs consumererror.As[Traces|Metrics|Logs]
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 7e8cc96 commit 2032c68

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Remove `config.Pipeline.Name` (#4326)
1818
- Remove `config.Pipeline.InputDataType` (#4343)
1919
- otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349)
20+
- Remove deprecated funcs `consumererror.As[Traces|Metrics|Logs]` (#4364)
2021

2122
## v0.38.0 Beta
2223

consumer/consumererror/signalerrors.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror"
1616

1717
import (
18-
"errors"
19-
2018
"go.opentelemetry.io/collector/model/pdata"
2119
)
2220

@@ -35,16 +33,6 @@ func NewTraces(err error, failed pdata.Traces) error {
3533
}
3634
}
3735

38-
// AsTraces finds the first error in err's chain that can be assigned to target. If such an error is found,
39-
// it is assigned to target and true is returned, otherwise false is returned.
40-
// Deprecated: Use `errors.As(err, target)` instead.
41-
func AsTraces(err error, target *Traces) bool {
42-
if err == nil {
43-
return false
44-
}
45-
return errors.As(err, target)
46-
}
47-
4836
// GetTraces returns failed traces from the associated error.
4937
func (err Traces) GetTraces() pdata.Traces {
5038
return err.failed
@@ -70,16 +58,6 @@ func NewLogs(err error, failed pdata.Logs) error {
7058
}
7159
}
7260

73-
// AsLogs finds the first error in err's chain that can be assigned to target. If such an error is found,
74-
// it is assigned to target and true is returned, otherwise false is returned.
75-
// Deprecated: Use `errors.As(err, target)` instead.
76-
func AsLogs(err error, target *Logs) bool {
77-
if err == nil {
78-
return false
79-
}
80-
return errors.As(err, target)
81-
}
82-
8361
// GetLogs returns failed logs from the associated error.
8462
func (err Logs) GetLogs() pdata.Logs {
8563
return err.failed
@@ -105,16 +83,6 @@ func NewMetrics(err error, failed pdata.Metrics) error {
10583
}
10684
}
10785

108-
// AsMetrics finds the first error in err's chain that can be assigned to target. If such an error is found,
109-
// it is assigned to target and true is returned, otherwise false is returned.
110-
// Deprecated: Use `errors.As(err, target)` instead.
111-
func AsMetrics(err error, target *Metrics) bool {
112-
if err == nil {
113-
return false
114-
}
115-
return errors.As(err, target)
116-
}
117-
11886
// GetMetrics returns failed metrics from the associated error.
11987
func (err Metrics) GetMetrics() pdata.Metrics {
12088
return err.failed

0 commit comments

Comments
 (0)