watchtower
                                
                                 watchtower copied to clipboard
                                
                                    watchtower copied to clipboard
                            
                            
                            
                        Metrics to report when an update is available
Is your feature request related to a problem? Please describe.
My current setup involves many LXC's in proxmox per use-case (e.g. a monitoring LXC that uses docker compose to setup grafana, prometheus, influxdb, etc). My workflow is to rely upon watchtower to monitor an individual LXC for updates but I haven't found a great way to collect the list of pending updates that exist. While I am aware that I can just use watchtower to update things automatically, I prefer that this is manual process so I set watchtower to monitor only. I'm looking for a good way to notify myself of pending updates across many different LXCs (each running their own watchtower).
Describe the solution you'd like
I noticed that metrics are published and can be scraped by prometheus. What I would like to see in the list of published metrics would be something to state that an update is available in addition to the existing metrics so I can monitor this and manually update as I see fit.
Describe alternatives you've considered
Alternatives that would possibly work for my use case would be publishing a custom webhook notification to home assistant and doing work in HA to collect/parse and update some list to display somewhere, but that seems overly complicated. I'm already using tools like grafana/prometheus and would love to see this use-case supported as well.
Additional context
No response
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏
Well, there is the --porcelain v1 flag that you can use to write a machine-readable to stdout after each run. You can also add another notification service to push that output to a HTTP server if you prefer, something like this:
--notification-url generic+http://host.docker.internal:8080
Thanks for the suggestions, and yes, you're correct, I can get this context out of watchtower, would just like to rely on the metrics API for the data as well since I'm already going to be interacting with it.
Interesting! We could consider adding a "has updates" metric gauge to the metrics endpoint. This would only be a numerical however, and would not give any information about which container to update, as adding container/image name as a metric label could have a negative performance impact on your prometheus due to it's risk of increasing the cardinality.