From your tabular data (the two simple columns), you can use Miller (mlr) to create the initial array and then the same jq or jtc command to insert it all under the data key:
$ mlr --n2j -S label '{#HOSTNAME},{#SIZE}' file | jtc -T '{ "data": {{}} }' -tc
{
"data": [
{ "{#HOSTNAME}": "host1", "{#SIZE}": "28" },
{ "{#HOSTNAME}": "host2", "{#SIZE}": "13" },
{ "{#HOSTNAME}": "host3", "{#SIZE}": "79" },
{ "{#HOSTNAME}": "host4", "{#SIZE}": "28" },
{ "{#HOSTNAME}": "host5", "{#SIZE}": "17" }
]
}
I use --n2j as a shorthand for --inidx and --ojson ("read toolbox indexed formatted data, write JSON"), and I added -S to stop Miller from inferring that the size data should be integers (and instead tread it as strings).