From 9eeb4a845bc3469f0a9e3fbbde4a198ba0962d0c Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 3 Jun 2024 13:52:10 -0600 Subject: [PATCH] fix(inputs.cloudwatch): Add accounts when enabled (#15440) --- plugins/inputs/cloudwatch/cloudwatch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/inputs/cloudwatch/cloudwatch.go b/plugins/inputs/cloudwatch/cloudwatch.go index 86bdbd9849383..12fceac611c02 100644 --- a/plugins/inputs/cloudwatch/cloudwatch.go +++ b/plugins/inputs/cloudwatch/cloudwatch.go @@ -262,6 +262,10 @@ func getFilteredMetrics(c *CloudWatch) ([]filteredMetric, error) { }) } } + if c.IncludeLinkedAccounts { + _, allAccounts := c.fetchNamespaceMetrics() + accounts = append(accounts, allAccounts...) + } } else { allMetrics, allAccounts := c.fetchNamespaceMetrics()