From 2a63f711a37e06e7633a1e00777c21b7c5a0f2b0 Mon Sep 17 00:00:00 2001 From: Varun C Date: Mon, 6 Jan 2025 17:29:22 +0000 Subject: [PATCH] nonamederrors fix --- plugins/outputs/cloudwatch/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/outputs/cloudwatch/util.go b/plugins/outputs/cloudwatch/util.go index f1386c144b..45d4b30e9c 100644 --- a/plugins/outputs/cloudwatch/util.go +++ b/plugins/outputs/cloudwatch/util.go @@ -100,12 +100,12 @@ func resize(dist distribution.Distribution, listMaxSize int) (distList []distrib } func payload(datum *cloudwatch.MetricDatum, entity *cloudwatch.Entity) (size int) { + size += timestampSize + if entity != nil { size += calculateEntitySize(*entity) } - size += timestampSize - for _, dimension := range datum.Dimensions { size += len(*dimension.Name) + len(*dimension.Value) + dimensionOverheads }