-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix cloudwatch-input query generation #10123
Conversation
Thanks so much for the pull request! |
👍 This pull request doesn't change the Telegraf binary size 📦 Looks like new artifacts were built from this PR. Expand this list to get them here ! 🐯Artifact URLs |
!signed-cla |
Thanks so much for the pull request! |
@maxmoehl I would love to see this merged next week before we cut 1.21. Can you look at signing the CLA please? |
Required for all PRs:
Resolves: #10122
getDataQueries
iterates over allfilteredMetrics
and takes the address of the metric from that list to store it in thedataQueries
map. However since go seems to re-use the same object for every iteration of the loop the pointer that is taken always points to the exact same memory location. Due to this theMetric
field will always contain the same pointer (and therefore value) after the for loop is done. The fix is easy and I will provide it as soon as I am done with this issue: the metric struct needs to be copied once to allocate new memory, after that the address can be taken.