@@ -98,11 +98,12 @@ func (cp *CommandPlugin) Process(ctx context.Context, msg *bus.Message) {
9898 case bus .DataPlaneResponseTopic :
9999 cp .processDataPlaneResponse (ctx , msg )
100100 default :
101- slog .DebugContext (ctx , "Command plugin unknown topic" , "topic" , msg .Topic )
101+ slog .DebugContext (ctx , "Command plugin received unknown topic" , "topic" , msg .Topic )
102102 }
103103}
104104
105105func (cp * CommandPlugin ) processResourceUpdate (ctx context.Context , msg * bus.Message ) {
106+ slog .DebugContext (ctx , "Command plugin received resource update message" )
106107 if resource , ok := msg .Data .(* mpi.Resource ); ok {
107108 if ! cp .commandService .IsConnected () {
108109 cp .createConnection (ctx , resource )
@@ -138,9 +139,10 @@ func (cp *CommandPlugin) createConnection(ctx context.Context, resource *mpi.Res
138139}
139140
140141func (cp * CommandPlugin ) processDataPlaneHealth (ctx context.Context , msg * bus.Message ) {
142+ slog .DebugContext (ctx , "Command plugin received data plane health message" )
141143 if instances , ok := msg .Data .([]* mpi.InstanceHealth ); ok {
142144 err := cp .commandService .UpdateDataPlaneHealth (ctx , instances )
143- correlationID := logger .GetCorrelationID (ctx )
145+ correlationID := logger .CorrelationID (ctx )
144146 if err != nil {
145147 slog .ErrorContext (ctx , "Unable to update data plane health" , "error" , err )
146148 cp .messagePipe .Process (ctx , & bus.Message {
@@ -152,12 +154,13 @@ func (cp *CommandPlugin) processDataPlaneHealth(ctx context.Context, msg *bus.Me
152154 cp .messagePipe .Process (ctx , & bus.Message {
153155 Topic : bus .DataPlaneResponseTopic ,
154156 Data : cp .createDataPlaneResponse (correlationID , mpi .CommandResponse_COMMAND_STATUS_OK ,
155- "Successfully sent the health status update" , "" ),
157+ "Successfully sent health status update" , "" ),
156158 })
157159 }
158160}
159161
160162func (cp * CommandPlugin ) processInstanceHealth (ctx context.Context , msg * bus.Message ) {
163+ slog .DebugContext (ctx , "Command plugin received instance health message" )
161164 if instances , ok := msg .Data .([]* mpi.InstanceHealth ); ok {
162165 err := cp .commandService .UpdateDataPlaneHealth (ctx , instances )
163166 if err != nil {
@@ -167,7 +170,10 @@ func (cp *CommandPlugin) processInstanceHealth(ctx context.Context, msg *bus.Mes
167170}
168171
169172func (cp * CommandPlugin ) processDataPlaneResponse (ctx context.Context , msg * bus.Message ) {
173+ slog .DebugContext (ctx , "Command plugin received data plane response message" )
170174 if response , ok := msg .Data .(* mpi.DataPlaneResponse ); ok {
175+ slog .InfoContext (ctx , "Sending data plane response message" , "message" ,
176+ response .GetCommandResponse ().GetMessage (), "status" , response .GetCommandResponse ().GetStatus ())
171177 err := cp .commandService .SendDataPlaneResponse (ctx , response )
172178 if err != nil {
173179 slog .ErrorContext (ctx , "Unable to send data plane response" , "error" , err )
@@ -176,7 +182,7 @@ func (cp *CommandPlugin) processDataPlaneResponse(ctx context.Context, msg *bus.
176182}
177183
178184func (cp * CommandPlugin ) processConnectionReset (ctx context.Context , msg * bus.Message ) {
179- slog .DebugContext (ctx , "Command plugin received connection reset" )
185+ slog .DebugContext (ctx , "Command plugin received connection reset message " )
180186 if newConnection , ok := msg .Data .(grpc.GrpcConnectionInterface ); ok {
181187 connectionErr := cp .conn .Close (ctx )
182188 if connectionErr != nil {
@@ -217,12 +223,16 @@ func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) {
217223
218224 switch message .GetRequest ().(type ) {
219225 case * mpi.ManagementPlaneRequest_ConfigUploadRequest :
226+ slog .InfoContext (ctx , "Received management plane config upload request" )
220227 cp .handleConfigUploadRequest (newCtx , message )
221228 case * mpi.ManagementPlaneRequest_ConfigApplyRequest :
229+ slog .InfoContext (ctx , "Received management plane config apply request" )
222230 cp .handleConfigApplyRequest (newCtx , message )
223231 case * mpi.ManagementPlaneRequest_HealthRequest :
232+ slog .InfoContext (ctx , "Received management plane health request" )
224233 cp .handleHealthRequest (newCtx )
225234 case * mpi.ManagementPlaneRequest_ActionRequest :
235+ slog .InfoContext (ctx , "Received management plane action request" )
226236 cp .handleAPIActionRequest (newCtx , message )
227237 default :
228238 slog .DebugContext (newCtx , "Management plane request not implemented yet" )
0 commit comments