Skip to content

Commit

Permalink
Move get attribute inside condition where used (#12604)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Nov 10, 2024
1 parent 0e099b2 commit 591cdf5
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,23 @@ public InternalNetworkAttributesExtractor(
}

public void onEnd(AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response) {
String protocolName = lowercase(getter.getNetworkProtocolName(request, response));
String protocolVersion = lowercase(getter.getNetworkProtocolVersion(request, response));

if (captureProtocolAttributes) {
String transport = lowercase(getter.getNetworkTransport(request, response));
internalSet(attributes, NetworkAttributes.NETWORK_TRANSPORT, transport);
internalSet(
attributes,
NetworkAttributes.NETWORK_TRANSPORT,
lowercase(getter.getNetworkTransport(request, response)));
internalSet(
attributes,
NetworkAttributes.NETWORK_TYPE,
lowercase(getter.getNetworkType(request, response)));
internalSet(attributes, NetworkAttributes.NETWORK_PROTOCOL_NAME, protocolName);
internalSet(attributes, NetworkAttributes.NETWORK_PROTOCOL_VERSION, protocolVersion);
internalSet(
attributes,
NetworkAttributes.NETWORK_PROTOCOL_NAME,
lowercase(getter.getNetworkProtocolName(request, response)));
internalSet(
attributes,
NetworkAttributes.NETWORK_PROTOCOL_VERSION,
lowercase(getter.getNetworkProtocolVersion(request, response)));
}

if (captureLocalSocketAttributes) {
Expand Down

0 comments on commit 591cdf5

Please sign in to comment.