fetch metrics and generate samples