fix: Output erroneous namespace and continue instead of error out (#11069)

This commit is contained in:
Sergey Lanzman 2022-05-16 22:27:00 +03:00 committed by GitHub
parent 5014d6b2b3
commit 23afa9f28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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...)