Why it matters
Automatic restarts hide the problem: the service looks up most of the time, but requests fail every few seconds. The cause is in the first error the service logs on start, often a bad config, a missing file or a port already in use.
How to check it on Linux
Restart count for a unit, or for a Docker container:
systemctl show -p NRestarts myapp && docker inspect -f "{{.RestartCount}}" myappWhat Opservo does about it
The health score flags a service that keeps restarting, so a loop is not mistaken for a running service. The Opservo Health Standard
Restart loop (flapping), answered
What is a restart loop?+
A restart loop is a service that crashes, is restarted automatically, and crashes again. It is also called flapping or, for containers, a crash loop.
How do I check a restart loop on Linux?+
Restart count for a unit, or for a Docker container: systemctl show -p NRestarts myapp && docker inspect -f "{{.RestartCount}}" myapp
How does Opservo handle a restart loop?+
The health score flags a service that keeps restarting, so a loop is not mistaken for a running service.