fix(outputs.cloudwatch): Increase number of metrics per write (#13930)

This commit is contained in:
Joshua Powers 2023-09-18 09:07:00 -06:00 committed by GitHub
parent df80446fae
commit c0bcf31bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -188,7 +188,9 @@ func (c *CloudWatch) Write(metrics []telegraf.Metric) error {
datums = append(datums, d...)
}
const maxDatumsPerCall = 20 // PutMetricData only supports up to 20 data metrics per call
// PutMetricData only supports up to 1000 data metrics per call
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html
const maxDatumsPerCall = 1000
for _, partition := range PartitionDatums(maxDatumsPerCall, datums) {
err := c.WriteToCloudWatch(partition)