It would be nice/common sense if AWS rolled out a built-in EC2 uptime metric (like RDS/Aurora has as standard) so you didn’t have to roll your own.
What does uptime mean?
Like, machine responds to a ping? VM is actually “running”? Some random port answers?
I have had machines happily respond to health checks (system and instance) that couldn’t actually perform work.
No a CW metrics graph of your current EC2 uptime, just like RDS Aurora has… so you can see how long the server has been in a started state for
Interesting, how are you solving it now?
I think what you’re looking for is the health check metric anyway
Oh I see, if you start and stop and start again, that won’t tell you a reboot occurred, right?
Solved by publishing a custom metric from the server, needed to know whether a server has been left “turned on” that shouldn’t have been.
Initially I thought T3 CPU credits could work, but it seems like maybe the behaviour has changed and now you keep those accrued credits when it stops rather than losing them (back to zero) so this can’t be used to eye-ball a rough “uptime”.
Anyways, just a gripe.
Very interesting use case, though. Someone left a machine on by accident, you want to identify them by the time gap between the instances last start event and current time. You don’t want to have to use the CloudWatch agent or cobble bash scripts to report things.