Most recent value or last seen value
<p>Prometheus is built around returning a <em>time series</em> representation of metrics. In many cases, however, I only care about what the state of a metric is <em>right now</em>, and I'm having a hard time figuring out a reliable way to get the "most recent" value of a metric.</p>

<p>Since right now it's getting metrics every 30 seconds, I tried something like this:</p>

<pre><code>my_metric[30s]
</code></pre>

<p>But this feels fragile. If metrics are dated any more or less than 30 seconds between data points, then I either get back more than one or zero results.</p>

<p>How can I get the most recent value of a metric?</p>