Skip to content

Commit

Permalink
[transport] make dial error logging compatible with ECS (#227)
Browse files Browse the repository at this point in the history
The LoggingDiler was logging an error with the field 'network' set as
the network type (tcp/upd), however 'network' is an object in ECS,
this would cause the log entry to be rejected by Elasticsearch.
  • Loading branch information
belimawr authored Sep 9, 2024
1 parent 999dd7a commit 1111a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type loggingConn struct {

func LoggingDialer(d Dialer, logger *logp.Logger) Dialer {
return DialerFunc(func(ctx context.Context, network, addr string) (net.Conn, error) {
logger := logger.With("network", network, "address", addr)
logger := logger.With("network.transport", network, "server.address", addr)
c, err := d.DialContext(ctx, network, addr)
if err != nil {
logger.Errorf("Error dialing %v", err)
Expand Down

0 comments on commit 1111a9e

Please sign in to comment.