Skip to content

Commit 851d668

Browse files
committed
Move getMessageBodySize and getMessageEnvelopeSize back to onStart
1 parent b1edd96 commit 851d668

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingAttributesExtractor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST
160160
attributes, MESSAGING_DESTINATION_PARTITION_ID, getter.getDestinationPartitionId(request));
161161

162162
internalSet(attributes, MESSAGING_MESSAGE_CONVERSATION_ID, getter.getConversationId(request));
163+
internalSet(attributes, MESSAGING_MESSAGE_BODY_SIZE, getter.getMessageBodySize(request));
164+
internalSet(
165+
attributes, MESSAGING_MESSAGE_ENVELOPE_SIZE, getter.getMessageEnvelopeSize(request));
163166
}
164167

165168
@Override
@@ -173,10 +176,6 @@ public void onEnd(
173176
internalSet(
174177
attributes, MESSAGING_BATCH_MESSAGE_COUNT, getter.getBatchMessageCount(request, response));
175178

176-
internalSet(attributes, MESSAGING_MESSAGE_BODY_SIZE, getter.getMessageBodySize(request));
177-
internalSet(
178-
attributes, MESSAGING_MESSAGE_ENVELOPE_SIZE, getter.getMessageEnvelopeSize(request));
179-
180179
for (String name : capturedHeaders) {
181180
List<String> values = getter.getMessageHeader(request, name);
182181
if (!values.isEmpty()) {

0 commit comments

Comments
 (0)