How to configure GCP log's resource_name to be the VM hostname?
I collect logs from GCP VMs using ops-agent. However, the labels.compute.googleapis.com/resource_name is not showing the hostname of the VM. Instead, it is showing the source disk of the VM's boot image.
After my own troubleshooting, it happens to be some residue problem of my custom image. Upon reboot of the VM creation, the hostname is correctly and effectively changed.