From c8ba938e707c0eff5ad9a6920f0eb3557f5cc76f Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Thu, 19 Sep 2019 01:13:14 +0200 Subject: [PATCH] client_stats: Always emit client stats --- client/client.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/client/client.go b/client/client.go index 98faa36525b..fe55e04860c 100644 --- a/client/client.go +++ b/client/client.go @@ -2575,19 +2575,15 @@ func (c *Client) emitStats() { for { select { case <-next.C: - start := time.Now() err := c.hostStatsCollector.Collect() next.Reset(c.config.StatsCollectionInterval) - end := time.Now() - duration := end.Sub(start) if err != nil { - c.logger.Warn("error fetching host resource usage stats", "error", err, "collection_duration", duration) - continue - } - - // Publish Node metrics if operator has opted in - if c.config.PublishNodeMetrics { - c.emitHostStats() + c.logger.Warn("error fetching host resource usage stats", "error", err) + } else { + // Publish Node metrics if operator has opted in + if c.config.PublishNodeMetrics { + c.emitHostStats() + } } c.emitClientMetrics()