Move get attribute inside condition where used (#12604)
This commit is contained in:
parent
0e099b281b
commit
591cdf5c79
|
|
@ -33,18 +33,23 @@ public final class InternalNetworkAttributesExtractor<REQUEST, RESPONSE> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEnd(AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response) {
|
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) {
|
if (captureProtocolAttributes) {
|
||||||
String transport = lowercase(getter.getNetworkTransport(request, response));
|
internalSet(
|
||||||
internalSet(attributes, NetworkAttributes.NETWORK_TRANSPORT, transport);
|
attributes,
|
||||||
|
NetworkAttributes.NETWORK_TRANSPORT,
|
||||||
|
lowercase(getter.getNetworkTransport(request, response)));
|
||||||
internalSet(
|
internalSet(
|
||||||
attributes,
|
attributes,
|
||||||
NetworkAttributes.NETWORK_TYPE,
|
NetworkAttributes.NETWORK_TYPE,
|
||||||
lowercase(getter.getNetworkType(request, response)));
|
lowercase(getter.getNetworkType(request, response)));
|
||||||
internalSet(attributes, NetworkAttributes.NETWORK_PROTOCOL_NAME, protocolName);
|
internalSet(
|
||||||
internalSet(attributes, NetworkAttributes.NETWORK_PROTOCOL_VERSION, protocolVersion);
|
attributes,
|
||||||
|
NetworkAttributes.NETWORK_PROTOCOL_NAME,
|
||||||
|
lowercase(getter.getNetworkProtocolName(request, response)));
|
||||||
|
internalSet(
|
||||||
|
attributes,
|
||||||
|
NetworkAttributes.NETWORK_PROTOCOL_VERSION,
|
||||||
|
lowercase(getter.getNetworkProtocolVersion(request, response)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (captureLocalSocketAttributes) {
|
if (captureLocalSocketAttributes) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue