0

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!

Matthew
  • 411
  • 6
  • 22

2 Answers2

1

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

 time() - container_start_time_seconds
wbh1
  • 397
  • 1
  • 4
  • Sweet! Will try it! Thanks! – Matthew Oct 22 '18 at 13:18
  • tried this method but it just alerts on everything. I tried specifying the container name like so: time() - container_start_time_seconds{container_name}, but it didn't work for some reason. – Matthew Oct 24 '18 at 08:34
0

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

Matthew
  • 411
  • 6
  • 22