From 3ce79b5dd027e4890810407f2af9483097bc1fd3 Mon Sep 17 00:00:00 2001 From: Przemek Maciolek Date: Fri, 5 Mar 2021 15:25:40 +0100 Subject: [PATCH] Fix handling the loop for empty attributes --- exporter/loggingexporter/logging_exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/loggingexporter/logging_exporter.go b/exporter/loggingexporter/logging_exporter.go index fbc1dd7e8cd..40f201c898b 100644 --- a/exporter/loggingexporter/logging_exporter.go +++ b/exporter/loggingexporter/logging_exporter.go @@ -235,7 +235,7 @@ func (b *logDataBuffer) logEvents(description string, se pdata.SpanEventSlice) { b.logEntry(" -> DroppedAttributesCount: %d", e.DroppedAttributesCount()) if e.Attributes().Len() == 0 { - return + continue } b.logEntry(" -> Attributes:") e.Attributes().ForEach(func(k string, v pdata.AttributeValue) { @@ -259,7 +259,7 @@ func (b *logDataBuffer) logLinks(description string, sl pdata.SpanLinkSlice) { b.logEntry(" -> TraceState: %s", l.TraceState()) b.logEntry(" -> DroppedAttributesCount: %d", l.DroppedAttributesCount()) if l.Attributes().Len() == 0 { - return + continue } b.logEntry(" -> Attributes:") l.Attributes().ForEach(func(k string, v pdata.AttributeValue) {