46
46
},
47
47
)
48
48
49
+ // SyncProxyRulesLastTimestamp is the timestamp proxy rules were last
50
+ // successfully synced.
51
+ SyncProxyRulesLastTimestamp = prometheus .NewGauge (
52
+ prometheus.GaugeOpts {
53
+ Subsystem : kubeProxySubsystem ,
54
+ Name : "sync_proxy_rules_last_timestamp_seconds" ,
55
+ Help : "The last time proxy rules were successfully synced" ,
56
+ },
57
+ )
58
+
49
59
// NetworkProgrammingLatency is defined as the time it took to program the network - from the time
50
60
// the service or pod has changed to the time the change was propagated and the proper kube-proxy
51
61
// rules were synced. Exported for each endpoints object that were part of the rules sync.
63
73
Buckets : prometheus .ExponentialBuckets (0.001 , 2 , 20 ),
64
74
},
65
75
)
76
+
77
+ // EndpointChangesPending is the number of pending endpoint changes that
78
+ // have not yet been synced to the proxy.
79
+ EndpointChangesPending = prometheus .NewGauge (
80
+ prometheus.GaugeOpts {
81
+ Subsystem : kubeProxySubsystem ,
82
+ Name : "sync_proxy_rules_endpoint_changes_pending" ,
83
+ Help : "Pending proxy rules Endpoint changes" ,
84
+ },
85
+ )
86
+
87
+ // EndpointChangesTotal is the number of endpoint changes that the proxy
88
+ // has seen.
89
+ EndpointChangesTotal = prometheus .NewCounter (
90
+ prometheus.CounterOpts {
91
+ Subsystem : kubeProxySubsystem ,
92
+ Name : "sync_proxy_rules_endpoint_changes_total" ,
93
+ Help : "Cumulative proxy rules Endpoint changes" ,
94
+ },
95
+ )
96
+
97
+ // ServiceChangesPending is the number of pending service changes that
98
+ // have not yet been synced to the proxy.
99
+ ServiceChangesPending = prometheus .NewGauge (
100
+ prometheus.GaugeOpts {
101
+ Subsystem : kubeProxySubsystem ,
102
+ Name : "sync_proxy_rules_service_changes_pending" ,
103
+ Help : "Pending proxy rules Service changes" ,
104
+ },
105
+ )
106
+
107
+ // ServiceChangesTotal is the number of service changes that the proxy has
108
+ // seen.
109
+ ServiceChangesTotal = prometheus .NewCounter (
110
+ prometheus.CounterOpts {
111
+ Subsystem : kubeProxySubsystem ,
112
+ Name : "sync_proxy_rules_service_changes_total" ,
113
+ Help : "Cumulative proxy rules Service changes" ,
114
+ },
115
+ )
66
116
)
67
117
68
118
var registerMetricsOnce sync.Once
@@ -72,7 +122,12 @@ func RegisterMetrics() {
72
122
registerMetricsOnce .Do (func () {
73
123
prometheus .MustRegister (SyncProxyRulesLatency )
74
124
prometheus .MustRegister (DeprecatedSyncProxyRulesLatency )
125
+ prometheus .MustRegister (SyncProxyRulesLastTimestamp )
75
126
prometheus .MustRegister (NetworkProgrammingLatency )
127
+ prometheus .MustRegister (EndpointChangesPending )
128
+ prometheus .MustRegister (EndpointChangesTotal )
129
+ prometheus .MustRegister (ServiceChangesPending )
130
+ prometheus .MustRegister (ServiceChangesTotal )
76
131
})
77
132
}
78
133
0 commit comments