I’m trying to use the API to capture automatic restart events. It seems there is no unique event for this specific case. Instead you need to expect a pattern:
# restart - die, start, restart
# stop - die, stop
# start - start
# abend - die, start
In other words you need to track the sequence die, start and then check there is no restart event in order to know that the container was automatically restarted, instead of just restarted with the restart command.
Is there any easier way that I am missing ? If not could we have something like an autorestart event ? It would be nice to be able to trap “the container died” rather than it stopped succinctly.