Skip to content

Commit b717fc6

Browse files
Merge pull request #16179 from DirectXMan12/refactor/fix-hybrid-proxy-verbosity
Automatic merge from submit-queue. Fix Hybrid Proxy Logging Verbosity This commit fixes the verbosity of the hybrid proxy, which was incorrectly set to log at verbosity 1, which added a lot of noise to the logs. This commit moves the verbosity to level 6, since the logging can be useful for debugging the hybrid proxy, but in general the logging from the individual proxies should be sufficient. Fixes #16132
2 parents edaecc4 + 1b6a5cc commit b717fc6

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

pkg/proxy/hybrid/proxy.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (p *HybridProxier) OnServiceAdd(service *api.Service) {
7777
glog.V(6).Infof("hybrid proxy: add svc %s in unidling proxy", service.Name)
7878
p.unidlingServiceHandler.OnServiceAdd(service)
7979
} else {
80-
glog.V(1).Infof("hybrid proxy: add svc %s in main proxy", service.Name)
80+
glog.V(6).Infof("hybrid proxy: add svc %s in main proxy", service.Name)
8181
p.mainServicesHandler.OnServiceAdd(service)
8282
}
8383
}
@@ -112,18 +112,18 @@ func (p *HybridProxier) OnServiceDelete(service *api.Service) {
112112
defer p.usingUserspaceLock.Unlock()
113113

114114
if isUsingUserspace, ok := p.usingUserspace[svcName]; ok && isUsingUserspace {
115-
glog.V(1).Infof("hybrid proxy: del svc %s in unidling proxy", service.Name)
115+
glog.V(6).Infof("hybrid proxy: del svc %s in unidling proxy", service.Name)
116116
p.unidlingServiceHandler.OnServiceDelete(service)
117117
} else {
118-
glog.V(1).Infof("hybrid proxy: del svc %s in main proxy", service.Name)
118+
glog.V(6).Infof("hybrid proxy: del svc %s in main proxy", service.Name)
119119
p.mainServicesHandler.OnServiceDelete(service)
120120
}
121121
}
122122

123123
func (p *HybridProxier) OnServiceSynced() {
124124
p.unidlingServiceHandler.OnServiceSynced()
125125
p.mainServicesHandler.OnServiceSynced()
126-
glog.V(1).Infof("hybrid proxy: services synced")
126+
glog.V(6).Infof("hybrid proxy: services synced")
127127
}
128128

129129
// shouldEndpointsUseUserspace checks to see if the given endpoints have the correct
@@ -154,11 +154,11 @@ func (p *HybridProxier) switchService(name types.NamespacedName) {
154154
}
155155

156156
if p.usingUserspace[name] {
157-
glog.V(1).Infof("hybrid proxy: switching svc %s to unidling proxy", svc.Name)
157+
glog.V(6).Infof("hybrid proxy: switching svc %s to unidling proxy", svc.Name)
158158
p.unidlingServiceHandler.OnServiceAdd(svc)
159159
p.mainServicesHandler.OnServiceDelete(svc)
160160
} else {
161-
glog.V(1).Infof("hybrid proxy: switching svc %s to main proxy", svc.Name)
161+
glog.V(6).Infof("hybrid proxy: switching svc %s to main proxy", svc.Name)
162162
p.mainServicesHandler.OnServiceAdd(svc)
163163
p.unidlingServiceHandler.OnServiceDelete(svc)
164164
}
@@ -167,7 +167,7 @@ func (p *HybridProxier) switchService(name types.NamespacedName) {
167167
func (p *HybridProxier) OnEndpointsAdd(endpoints *api.Endpoints) {
168168
// we track all endpoints in the unidling endpoints handler so that we can succesfully
169169
// detect when a service become unidling
170-
glog.V(1).Infof("hybrid proxy: (always) add ep %s in unidling proxy", endpoints.Name)
170+
glog.V(6).Infof("hybrid proxy: (always) add ep %s in unidling proxy", endpoints.Name)
171171
p.unidlingEndpointsHandler.OnEndpointsAdd(endpoints)
172172

173173
p.usingUserspaceLock.Lock()
@@ -182,7 +182,7 @@ func (p *HybridProxier) OnEndpointsAdd(endpoints *api.Endpoints) {
182182
p.usingUserspace[svcName] = p.shouldEndpointsUseUserspace(endpoints)
183183

184184
if !p.usingUserspace[svcName] {
185-
glog.V(1).Infof("hybrid proxy: add ep %s in main proxy", endpoints.Name)
185+
glog.V(6).Infof("hybrid proxy: add ep %s in main proxy", endpoints.Name)
186186
p.mainEndpointsHandler.OnEndpointsAdd(endpoints)
187187
}
188188

@@ -196,7 +196,7 @@ func (p *HybridProxier) OnEndpointsAdd(endpoints *api.Endpoints) {
196196
func (p *HybridProxier) OnEndpointsUpdate(oldEndpoints, endpoints *api.Endpoints) {
197197
// we track all endpoints in the unidling endpoints handler so that we can succesfully
198198
// detect when a service become unidling
199-
glog.V(1).Infof("hybrid proxy: (always) update ep %s in unidling proxy", endpoints.Name)
199+
glog.V(6).Infof("hybrid proxy: (always) update ep %s in unidling proxy", endpoints.Name)
200200
p.unidlingEndpointsHandler.OnEndpointsUpdate(oldEndpoints, endpoints)
201201

202202
p.usingUserspaceLock.Lock()
@@ -218,16 +218,16 @@ func (p *HybridProxier) OnEndpointsUpdate(oldEndpoints, endpoints *api.Endpoints
218218
isSwitch := wasUsingUserspace != p.usingUserspace[svcName]
219219

220220
if !isSwitch && !p.usingUserspace[svcName] {
221-
glog.V(1).Infof("hybrid proxy: update ep %s in main proxy", endpoints.Name)
221+
glog.V(6).Infof("hybrid proxy: update ep %s in main proxy", endpoints.Name)
222222
p.mainEndpointsHandler.OnEndpointsUpdate(oldEndpoints, endpoints)
223223
return
224224
}
225225

226226
if p.usingUserspace[svcName] {
227-
glog.V(1).Infof("hybrid proxy: del ep %s in main proxy", endpoints.Name)
227+
glog.V(6).Infof("hybrid proxy: del ep %s in main proxy", endpoints.Name)
228228
p.mainEndpointsHandler.OnEndpointsDelete(oldEndpoints)
229229
} else {
230-
glog.V(1).Infof("hybrid proxy: add ep %s in main proxy", endpoints.Name)
230+
glog.V(6).Infof("hybrid proxy: add ep %s in main proxy", endpoints.Name)
231231
p.mainEndpointsHandler.OnEndpointsAdd(endpoints)
232232
}
233233

@@ -237,7 +237,7 @@ func (p *HybridProxier) OnEndpointsUpdate(oldEndpoints, endpoints *api.Endpoints
237237
func (p *HybridProxier) OnEndpointsDelete(endpoints *api.Endpoints) {
238238
// we track all endpoints in the unidling endpoints handler so that we can succesfully
239239
// detect when a service become unidling
240-
glog.V(1).Infof("hybrid proxy: (always) del ep %s in unidling proxy", endpoints.Name)
240+
glog.V(6).Infof("hybrid proxy: (always) del ep %s in unidling proxy", endpoints.Name)
241241
p.unidlingEndpointsHandler.OnEndpointsDelete(endpoints)
242242

243243
p.usingUserspaceLock.Lock()
@@ -256,7 +256,7 @@ func (p *HybridProxier) OnEndpointsDelete(endpoints *api.Endpoints) {
256256
}
257257

258258
if !usingUserspace {
259-
glog.V(1).Infof("hybrid proxy: del ep %s in main proxy", endpoints.Name)
259+
glog.V(6).Infof("hybrid proxy: del ep %s in main proxy", endpoints.Name)
260260
p.mainEndpointsHandler.OnEndpointsDelete(endpoints)
261261
}
262262

@@ -266,14 +266,14 @@ func (p *HybridProxier) OnEndpointsDelete(endpoints *api.Endpoints) {
266266
func (p *HybridProxier) OnEndpointsSynced() {
267267
p.unidlingEndpointsHandler.OnEndpointsSynced()
268268
p.mainEndpointsHandler.OnEndpointsSynced()
269-
glog.V(1).Infof("hybrid proxy: endpoints synced")
269+
glog.V(6).Infof("hybrid proxy: endpoints synced")
270270
}
271271

272272
// Sync is called to immediately synchronize the proxier state to iptables
273273
func (p *HybridProxier) Sync() {
274274
p.mainProxy.Sync()
275275
p.unidlingProxy.Sync()
276-
glog.V(5).Infof("hybrid proxy: proxies synced")
276+
glog.V(6).Infof("hybrid proxy: proxies synced")
277277
}
278278

279279
// SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.

0 commit comments

Comments
 (0)