title: How do I get Prometheus to show the latest values grouped by a dimension?
body: <p>I've got a metric <code>service_replicas_actual</code>. This metric has a dimension <code>name</code>. I need a query which will group by the <code>name</code> dimension and show the most recent value.</p>
  
  <p>The <code>name</code> dimension represents a Docker service, and <code>service_replicas_actual</code> keeps track of how many replicas (tasks) any given service had running at any given time. I need to create a table which will show the current number of replicas grouped by service name.</p>
  
  <p>I can't really find any documentation on how I can group by dimensions and then pick the most recent value. Is there a way to do this?</p>