Skip to content

Commit ee1e5f5

Browse files
committed
add debug logging
1 parent eebac77 commit ee1e5f5

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/tcs/handler/handler.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/wsclient/client.go

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ecs-agent/tcs/handler/handler.go

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func (session *telemetrySession) StartTelemetrySession(ctx context.Context) erro
194194
client.AddRequestHandler(ackPublishHealthMetricHandler(heartBeatTimer, session.heartbeatTimeout, session.heartbeatJitterMax))
195195
client.AddRequestHandler(ackPublishInstanceStatusHandler(heartBeatTimer, session.heartbeatTimeout, session.heartbeatJitterMax))
196196
client.SetAnyRequestHandler(anyMessageHandler(client, wsRWTimeout))
197+
197198
return client.Serve(ctx)
198199
}
199200

ecs-agent/wsclient/client.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (cs *ClientServerImpl) WriteMessage(send []byte) error {
482482
err, cs.URL))
483483
}
484484

485-
return cs.conn.WriteMessage(websocket.BinaryMessage, send)
485+
return cs.conn.WriteMessage(websocket.TextMessage, send)
486486
}
487487

488488
// WriteCloseMessage wraps the low level websocket WriteControl method with a lock, and sends a message of type
@@ -569,6 +569,11 @@ func (cs *ClientServerImpl) CreateRequestMessage(input interface{}) ([]byte, err
569569
break
570570
}
571571
}
572+
// Add debug logging for message type
573+
logger.Debug("Creating WebSocket message", logger.Fields{
574+
"messageType": msg.Type,
575+
"inputType": reflect.TypeOf(input).String(),
576+
})
572577
if msg.Type == "" {
573578
return nil, &UnrecognizedWSRequestType{reflect.TypeOf(input).String()}
574579
}

0 commit comments

Comments
 (0)