Skip to content

Commit 565867c

Browse files
committed
Address comments
1 parent 988d13b commit 565867c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/server/backend_manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func NewDefaultBackendManager() *DefaultBackendManager {
226226
func NewDefaultBackendStorage(idTypes []header.IdentifierType, proxyStrategy proxystrategies.ProxyStrategy) *DefaultBackendStorage {
227227
// Set an explicit value, so that the metric is emitted even when
228228
// no agent ever successfully connects.
229-
metrics.Metrics.SetBackendCount(0)
229+
metrics.Metrics.SetBackendCountDeprecated(0)
230230
metrics.Metrics.SetTotalBackendCount(proxyStrategy, 0)
231231

232232
return &DefaultBackendStorage{
@@ -262,7 +262,7 @@ func (s *DefaultBackendStorage) addBackend(identifier string, idType header.Iden
262262
return
263263
}
264264
s.backends[identifier] = []*Backend{backend}
265-
metrics.Metrics.SetBackendCount(len(s.backends))
265+
metrics.Metrics.SetBackendCountDeprecated(len(s.backends))
266266
metrics.Metrics.SetTotalBackendCount(s.proxyStrategy, len(s.backends))
267267
s.agentIDs = append(s.agentIDs, identifier)
268268
}
@@ -304,7 +304,7 @@ func (s *DefaultBackendStorage) removeBackend(identifier string, idType header.I
304304
if !found {
305305
klog.V(1).InfoS("Could not find connection matching identifier to remove", "agentID", identifier, "idType", idType)
306306
}
307-
metrics.Metrics.SetBackendCount(len(s.backends))
307+
metrics.Metrics.SetBackendCountDeprecated(len(s.backends))
308308
metrics.Metrics.SetTotalBackendCount(s.proxyStrategy, len(s.backends))
309309
}
310310

pkg/server/metrics/metrics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func newServerMetrics() *ServerMetrics {
112112
Namespace: Namespace,
113113
Subsystem: Subsystem,
114114
Name: "ready_backend_connections",
115-
Help: "Number of konnectivity agent connected to the proxy server",
115+
Help: "Number of konnectivity agent connected to the proxy server. DEPRECATED, please use ready_backend_connections_total",
116116
},
117117
[]string{},
118118
)
@@ -295,8 +295,8 @@ func (s *ServerMetrics) HTTPConnectionInc() { s.httpConnections.Inc() }
295295
// HTTPConnectionDec decrements a finished HTTP CONNECTION connection.
296296
func (s *ServerMetrics) HTTPConnectionDec() { s.httpConnections.Dec() }
297297

298-
// SetBackendCount sets the number of backend connection.
299-
func (s *ServerMetrics) SetBackendCount(count int) {
298+
// SetBackendCountDeprecated sets the number of backend connection.
299+
func (s *ServerMetrics) SetBackendCountDeprecated(count int) {
300300
s.backend.WithLabelValues().Set(float64(count))
301301
}
302302

pkg/testing/metrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const (
3838
serverPendingDialsSample = `konnectivity_network_proxy_server_pending_backend_dials{} %d`
3939

4040
serverReadyBackendsHeader = `
41-
# HELP konnectivity_network_proxy_server_ready_backend_connections Number of konnectivity agent connected to the proxy server
41+
# HELP konnectivity_network_proxy_server_ready_backend_connections Number of konnectivity agent connected to the proxy server. DEPRECATED, please use ready_backend_connections_total
4242
# TYPE konnectivity_network_proxy_server_ready_backend_connections gauge`
4343
serverReadyBackendsSample = `konnectivity_network_proxy_server_ready_backend_connections{} %d`
4444

0 commit comments

Comments
 (0)