title: prometheus query for continuous uptime
body: <p>I'm a prometheus newbie and have been trying to figure out the right query to get the last continuous uptime for my service.</p>
  
  <p>For example, if the present time is 0:01:20 my service was up at 0:00:00, went down at 0:01:01 and went up again at 0:01:10, I'd like to see the uptime of "10 seconds".</p>
  
  <p>I'm mainly looking at the "up{}" metric and possibly combine it with the functions (changes(), rate(), etc.) but no luck so far.  I don't see any other prometheus metric similar to "up" either.</p>