in pkg/client/client_v2.go [1116:1131]
func sendObservedChunked(client proto.ElasticAgent_CheckinV2Client, msg *proto.CheckinObserved, chunkingAllowed bool, maxSize int) error {
if !chunkingAllowed {
// chunking is disabled
return client.Send(msg)
}
msgs, err := chunk.Observed(msg, maxSize)
if err != nil {
return err
}
for _, msg := range msgs {
if err := client.Send(msg); err != nil {
return err
}
}
return nil
}