From d490c1ca002c8602718e954433d0b55a697bdec8 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 24 Nov 2021 14:54:22 -0700 Subject: [PATCH] [7.16](backport #29106) Fix rds metadata in cloudwatch metricset (#29129) * Fix rds metadata in cloudwatch metricset (#29106) (cherry picked from commit 559492373b6b52ca6f306064c61728fcbdec5ee2) * Update CHANGELOG.next.asciidoc Co-authored-by: kaiyan-sheng --- CHANGELOG.next.asciidoc | 1 + x-pack/metricbeat/module/aws/cloudwatch/metadata/rds/rds.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 0c32d05aa6e..4fd0e102ebd 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -212,6 +212,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Groups same timestamp metric values to one event in the app_insights metricset. {pull}20403[20403] - `beat` module respects `basepath` config option. {pull}28162[28162] - Fix list_docker.go {pull}28374[28374] +- Fix rds metadata in cloudwatch metricset. {pull}29106[29106] *Packetbeat* diff --git a/x-pack/metricbeat/module/aws/cloudwatch/metadata/rds/rds.go b/x-pack/metricbeat/module/aws/cloudwatch/metadata/rds/rds.go index c74234af7ce..e732749d016 100644 --- a/x-pack/metricbeat/module/aws/cloudwatch/metadata/rds/rds.go +++ b/x-pack/metricbeat/module/aws/cloudwatch/metadata/rds/rds.go @@ -87,7 +87,8 @@ func getDBInstancesPerRegion(svc rdsiface.ClientAPI) (map[string]*rds.DBInstance instancesOutputs := map[string]*rds.DBInstance{} for _, dbInstance := range output.DBInstances { - instancesOutputs[*dbInstance.DBInstanceIdentifier] = &dbInstance + instance := dbInstance + instancesOutputs[*instance.DBInstanceIdentifier] = &instance } return instancesOutputs, nil }