Log job attachment to Runner VM
Description
Problem: We need to be able to correlate machines spawned by CI Runners Managers to actual jobs and projects running in them in a quicker way
Proposal
As @steveazz suggested in the issue linked below, we should add lines to the runner logs something like this:
{ "level": "info", "msg": "Assign machine", "job_id": 1234, "project_id": 42, "machine_name": "machineA", "timestamp": UTCTimeStamp }
{ "level": "info", "msg": "Finised running job on machine", "job_id": 1234, "project_id": 42, "machine_name": "machineA", "timestamp": UTCTimeStamp }
In addition to the fields above, we should also add the VM's IP addresses if available.
This log should mark the start and end of a job being run in a VM and not necessarily document the lifecycle of a VM if the VM is reused, or idle.
Links to related issues and merge requests / references
Reference: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/2364#note_373474084 (internal)