Skip to content

Commit 99d6cf2

Browse files
committed
PR feedback
1 parent f313fd8 commit 99d6cf2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/logs/LogStatelessMarshaler.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,20 @@ public void writeTo(Serializer output, LogRecordData log, MarshalerContext conte
5555
output.serializeMessageWithContext(
5656
LogRecord.BODY, log.getBodyValue(), AnyValueStatelessMarshaler.INSTANCE, context);
5757
}
58+
59+
int droppedAttributesCount;
5860
if (INCUBATOR_AVAILABLE) {
5961
IncubatingUtil.serializeExtendedAttributes(output, log, context);
60-
61-
int droppedAttributesCount =
62-
log.getTotalAttributeCount() - IncubatingUtil.extendedAttributesSize(log);
63-
output.serializeUInt32(LogRecord.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount);
62+
droppedAttributesCount = log.getTotalAttributeCount() - IncubatingUtil.extendedAttributesSize(log);
6463
} else {
6564
output.serializeRepeatedMessageWithContext(
6665
LogRecord.ATTRIBUTES,
6766
log.getAttributes(),
6867
AttributeKeyValueStatelessMarshaler.INSTANCE,
6968
context);
70-
71-
int droppedAttributesCount = log.getTotalAttributeCount() - log.getAttributes().size();
72-
output.serializeUInt32(LogRecord.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount);
69+
droppedAttributesCount = log.getTotalAttributeCount() - log.getAttributes().size();
7370
}
71+
output.serializeUInt32(LogRecord.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount);
7472

7573
SpanContext spanContext = log.getSpanContext();
7674
output.serializeFixed32(LogRecord.FLAGS, spanContext.getTraceFlags().asByte());

0 commit comments

Comments
 (0)