Skip to content

Commit

Permalink
bugfix break infinite loop on aws billing (#32626) (#32660)
Browse files Browse the repository at this point in the history
* bugfix break infinite loop on aws billing

* changelog

* add warning about listing account error

(cherry picked from commit 9450332)

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
  • Loading branch information
mergify[bot] and Andrea Spacca authored Aug 11, 2022
1 parent 6322fe1 commit 95a8289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
- Check for nil metadata in GCP. {pull}32281[32281]
- update kubernetes controllermanager metricset to not collect deprecated metrics and fix dashboard {pull}32037[32037]
- Fix to ARN parsing for Cloudwatch resource names with leading slashes {pull}32358[32358]
- Fix an infinite loop in AWS billing metricset. {pull}32626[32626]
- Add missing metrics in AWS Transit Gateway module {pull}32617[32617]

*Packetbeat*
Expand Down
4 changes: 2 additions & 2 deletions x-pack/metricbeat/module/aws/billing/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ func (m *MetricSet) getAccountName(svc *organizations.Client) map[string]string
for paginator.HasMorePages() {
page, err := paginator.NextPage(context.Background())
if err != nil {
//TODO continue or return with error? Probably is return but...
continue
m.Logger().Warnf("an error occurred while listing account: %s", err.Error())
return accounts
}
for _, a := range page.Accounts {
accounts[*a.Id] = *a.Name
Expand Down

0 comments on commit 95a8289

Please sign in to comment.