From 23afa9f28c7cc538ac0321b5ef564d06507391d8 Mon Sep 17 00:00:00 2001 From: Sergey Lanzman Date: Mon, 16 May 2022 22:27:00 +0300 Subject: [PATCH] fix: Output erroneous namespace and continue instead of error out (#11069) --- plugins/inputs/cloudwatch/cloudwatch.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/cloudwatch/cloudwatch.go b/plugins/inputs/cloudwatch/cloudwatch.go index b75561cbf..4a87b1606 100644 --- a/plugins/inputs/cloudwatch/cloudwatch.go +++ b/plugins/inputs/cloudwatch/cloudwatch.go @@ -328,7 +328,9 @@ func (c *CloudWatch) fetchNamespaceMetrics() ([]types.Metric, error) { for { resp, err := c.client.ListMetrics(context.Background(), params) if err != nil { - return nil, fmt.Errorf("failed to list metrics with params per namespace: %v", err) + c.Log.Errorf("failed to list metrics with namespace %s: %v", namespace, err) + // skip problem namespace on error and continue to next namespace + break } metrics = append(metrics, resp.Metrics...)