From 1b1230bb69fba5c6c1653602d576b17025fbf50f Mon Sep 17 00:00:00 2001 From: Jon San Miguel Date: Tue, 30 Jul 2024 15:49:27 -0700 Subject: [PATCH] resolver_wrapper: add early return in addChannelzTraceEvent (#7437) --- resolver_wrapper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resolver_wrapper.go b/resolver_wrapper.go index d25052457c1b..23bb3fb25824 100644 --- a/resolver_wrapper.go +++ b/resolver_wrapper.go @@ -177,6 +177,9 @@ func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.P // addChannelzTraceEvent adds a channelz trace event containing the new // state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { + if !logger.V(0) && !channelz.IsOn() { + return + } var updates []string var oldSC, newSC *ServiceConfig var oldOK, newOK bool