From 2a7685d9ba4f611e28444f17edf7df4760603ff5 Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 22 Jul 2024 14:15:04 -0400 Subject: [PATCH] Take care of negative case first, better practice. --- .../translate/otel/exporter/awscloudwatch/translator.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translator/translate/otel/exporter/awscloudwatch/translator.go b/translator/translate/otel/exporter/awscloudwatch/translator.go index 736b2aeffd..a3f8094db1 100644 --- a/translator/translate/otel/exporter/awscloudwatch/translator.go +++ b/translator/translate/otel/exporter/awscloudwatch/translator.go @@ -173,10 +173,10 @@ func getDropOriginalMetrics(conf *confmap.Conf) map[string]bool { for _, dropMetric := range dropMetrics { if _, in := toDropMap[category]; in { dropMetric, ok := dropMetric.(string) - if ok { - dropOriginalMetrics[dropMetric] = true + if !ok { + continue } - continue + dropOriginalMetrics[dropMetric] = true } measurements := common.GetArray[any](conf, measurementCfgKey)