Watchtower: Add prometheus metrics

Created on 18 May 2019  路  9Comments  路  Source: containrrr/watchtower

Is your feature request related to a problem? Please describe.
I'm monitoring my containers trough cAdvisor with prometheus. This gives me nice metrics per container to see how they behave.

I'm also looking for a way to check if some containers are using an outdated image. I want to avoid running old software that might have security issues. Important is that I can't have my containers updated randomly during the day. This needs to be in an maintenance window.

I can already use --monitor-only, so this seems like a good idea. The only issue is that I now need a way to get this updatable information into prometheus.

Describe the solution you'd like
Provide metrics that prometheus can use to follow up when images are outdated. Usefull metrics might be:

  • watchtower_last_checked{container="whatever"} timestamp
  • watchtower_updatable{container="whatever"} 1/0
  • watchtower_updated{container="whatever"} timestamp
Do not close Medium Available Enhancement

Most helpful comment

I would propose a minor modification to @michaelarnauts request to implement metrics as follows:

Counter watchtower_updates_total{container="foo"} int
Gauge   watchtower_stale{container="foo"} 0/1
Gauge   watchtower_last_update{container="foo"} timestamp

As for last_checked I would say it isn't very important. Watchtower checks everything every X seconds, so this metric would be max X seconds behind last scrape, which doesn't give much new information.

Also I started implementing it :)

All 9 comments

Yeah, prometheus support seems like a really reasonable feature request for watchtower.
Feel free to create a pull request with the needed changes and I'll make sure to review it 馃檹

I would propose a minor modification to @michaelarnauts request to implement metrics as follows:

Counter watchtower_updates_total{container="foo"} int
Gauge   watchtower_stale{container="foo"} 0/1
Gauge   watchtower_last_update{container="foo"} timestamp

As for last_checked I would say it isn't very important. Watchtower checks everything every X seconds, so this metric would be max X seconds behind last scrape, which doesn't give much new information.

Also I started implementing it :)

Awesome!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@paulfantom do you have a merge request somewhere?

@paulfantom, may I assist you in any way in getting this feature ready for integration with master?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Reopening this as I believe this is something we really should have.

I've started implementing some kind of embryo for this in #450

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ag0r4n picture ag0r4n  路  4Comments

kiprasmel picture kiprasmel  路  5Comments

andreo picture andreo  路  6Comments

regystro picture regystro  路  5Comments

michael-siebers picture michael-siebers  路  5Comments