Handle null peerName in GrpcClientObservationConvention by GGGGGHT · Pull Request #7381 · micrometer-metrics/micrometer (original) (raw)

shakuzen

@jonatan-ivanov jonatan-ivanov changed the titlefix: handle null peerName in GrpcClientObservationConvention Handle null peerName in GrpcClientObservationConvention

Apr 6, 2026

@jonatan-ivanov

When NameResolver.getServiceAuthority() returns empty string, the ObservationGrpcClientInterceptor silently catches URISyntaxException, leaving peerName null. This caused NPE when DefaultGrpcClientObservationConvention.getLowCardinalityKeyValues() passed null to ImmutableKeyValue.requireNonNull().

Fix: Add null check for peerName with "UNKNOWN" fallback value, consistent with how other fields (statusCode, peerPort, method, service) are already handled.

Closes micrometer-metricsgh-7380

Co-authored-by: Jonatan Ivanov jonatan.ivanov@gmail.com Signed-off-by: zheng2.wang zheng2.wang@sigmob.com

shakuzen

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})