Matthew
Matthew

Reputation: 411

What is the Alert Manager alert rule for notifying about Docker container restarting?

I'm trying to add an alert rule that would allow Alert Manager to notify me whenever a particular docker container restarts. Does such rule exist? Any help would be greatly appreciated!

Upvotes: 0

Views: 766

Answers (2)

Matthew
Matthew

Reputation: 411

Ive managed to make it work with process_start_time_seconds{job='my_job'} expression

Upvotes: 0

wbh1
wbh1

Reputation: 407

You can use this query to see the number of seconds that have passed since the container was started.

 time() - container_start_time_seconds

Upvotes: 1

Related Questions