I'm not using Docker/cAdvisor myself, but something like the following maybe?
ALERT ContainerMissing
IF absent(container_last_seen{name="<container-name>"})
WITH {}
SUMMARY "..."
DESCRIPTION "..."
That would alert if the container_last_seen metric is not present at all for a given container name. If instead you want to alert if an existing last-seen timestamp is growing too old (1 hour, in this example), you could do something like:
ALERT ContainerLastSeenOld
IF time() - container_last_seen{name="<container-name>"} > 3600
WITH {}
SUMMARY "..."
DESCRIPTION "..."
...or if you want to combine the two in one alert (I guess that makes most sense, as both conditions would indicate that a container is gone / was never seen?):
ALERT ContainerMissing
IF absent(container_last_seen{name="<container-name>"}) or on (name) (time() - container_last_seen{name="<container-name>"} > 3600)
WITH {}
SUMMARY "..."
DESCRIPTION "..."
Just keep in mind that I haven't tested these at all and just scribbled these down :)
Cheers,
Julius