Skip to content

Commit 51a97b8

Browse files
author
Alexander Furer
committed
minor
1 parent 9919d82 commit 51a97b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/autoconfigure/metrics/GRpcMetricsAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public void close(Status status, Metadata trailers) {
6767
.tag("method", getMethodDescriptor().getFullMethodName())
6868
.tag("result", status.getCode().name());
6969
if (addAddressTag){
70-
Optional.ofNullable(delegate().getAttributes().get(Grpc.TRANSPORT_ATTR_LOCAL_ADDR))
70+
Optional.ofNullable(delegate().getAttributes())
71+
.map(a->a.get(Grpc.TRANSPORT_ATTR_LOCAL_ADDR))
7172
.map(SocketAddress::toString)
7273
.ifPresent(a->timerBuilder.tag("address",a));
7374
}

0 commit comments

Comments
 (0)