Skip to content

Commit

Permalink
[exporter/syslogexporter] use errors.Join instead of go.uber.org/mult…
Browse files Browse the repository at this point in the history
…ierr (open-telemetry#32925)

**Description:** 
syslogexporter: use errors.Join instead of go.uber.org/multierr

**Link to tracking Issue:** 

[open-telemetry#25121](open-telemetry#25121)

**Testing:** 

**Documentation:**
  • Loading branch information
acha1os authored and rimitchell committed May 8, 2024
1 parent 7070679 commit 2156591
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions exporter/syslogexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.uber.org/multierr"
)

var (
Expand Down Expand Up @@ -74,7 +73,7 @@ func (cfg *Config) Validate() error {
}

if len(invalidFields) > 0 {
return multierr.Combine(invalidFields...)
return errors.Join(invalidFields...)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion exporter/syslogexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestValidate(t *testing.T) {
Protocol: "rfc542",
Network: "udp",
},
err: "unsupported port: port is required, must be in the range 1-65535; " +
err: "unsupported port: port is required, must be in the range 1-65535" + "\n" +
"unsupported protocol: Only rfc5424 and rfc3164 supported",
},
{
Expand Down
4 changes: 2 additions & 2 deletions exporter/syslogexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package syslogexporter // import "github.com/open-telemetry/opentelemetry-collec
import (
"context"
"crypto/tls"
"errors"
"fmt"
"strings"

Expand All @@ -14,7 +15,6 @@ import (
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/pdata/plog"
"go.uber.org/multierr"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -142,7 +142,7 @@ func (se *syslogexporter) exportNonBatch(logs plog.Logs) error {

if len(errs) > 0 {
errs = deduplicateErrors(errs)
return consumererror.NewLogs(multierr.Combine(errs...), droppedLogs)
return consumererror.NewLogs(errors.Join(errs...), droppedLogs)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion exporter/syslogexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ require (
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0
go.opentelemetry.io/otel/trace v1.26.0
go.uber.org/multierr v1.11.0
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down

0 comments on commit 2156591

Please sign in to comment.