func getGceInstanceID() info.InstanceID { instanceID, err := metadata.Get("instance/id") if err != nil { return info.UnknownInstance } return info.InstanceID(info.InstanceType(instanceID)) }
func getGceInstanceType() info.InstanceType { machineType, err := metadata.Get("instance/machine-type") if err != nil { return info.UnknownInstance } responseParts := strings.Split(machineType, "/") // Extract the instance name from the machine type. return info.InstanceType(responseParts[len(responseParts)-1]) }
func getAwsInstanceType() info.InstanceType { return info.InstanceType(getAwsMetadata("instance-type")) }