From 33e928e380d56e40e2a7035c290d12062648b4a1 Mon Sep 17 00:00:00 2001 From: nerves_dev Date: Thu, 11 Mar 2021 01:42:27 +0900 Subject: [PATCH] fix container list option --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ab31346..f25328c 100644 --- a/main.go +++ b/main.go @@ -132,8 +132,9 @@ func (c *dockerHealthCollector) collectMetrics(ch chan<- prometheus.Metric) { ch <- prometheus.MustNewConstMetric(restartcountDesc.Desc(labels), prometheus.GaugeValue, float64(info.RestartCount)) } } + func (c *dockerHealthCollector) collectContainer() { - containers, err := c.containerClient.ContainerList(context.Background(), types.ContainerListOptions{}) + containers, err := c.containerClient.ContainerList(context.Background(), types.ContainerListOptions{All: true}) errCheck(err) c.containerInfoCache = []types.ContainerJSON{}