@@ -20,23 +20,23 @@ var (
2020 ipamAllocatedIPCount = prometheus .NewGaugeVec (
2121 prometheus.GaugeOpts {
2222 Name : "cx_ipam_pod_allocated_ips" ,
23- Help : "Count of IPs CNS has allocated to Pods." ,
23+ Help : "IPs currently in use by Pods on this CNS Node ." ,
2424 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
2525 },
2626 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
2727 )
2828 ipamAvailableIPCount = prometheus .NewGaugeVec (
2929 prometheus.GaugeOpts {
3030 Name : "cx_ipam_available_ips" ,
31- Help : "Available IP count ." ,
31+ Help : "IPs available on this CNS Node for use by a Pod ." ,
3232 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
3333 },
3434 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
3535 )
3636 ipamBatchSize = prometheus .NewGaugeVec (
3737 prometheus.GaugeOpts {
3838 Name : "cx_ipam_batch_size" ,
39- Help : "IPAM IP pool batch size." ,
39+ Help : "IPAM IP pool scaling batch size." ,
4040 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
4141 },
4242 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
@@ -60,65 +60,73 @@ var (
6060 ipamMaxIPCount = prometheus .NewGaugeVec (
6161 prometheus.GaugeOpts {
6262 Name : "cx_ipam_max_ips" ,
63- Help : "Maximum IP count ." ,
63+ Help : "Maximum Secondary IPs allowed on this Node ." ,
6464 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
6565 },
6666 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
6767 )
6868 ipamPendingProgramIPCount = prometheus .NewGaugeVec (
6969 prometheus.GaugeOpts {
7070 Name : "cx_ipam_pending_programming_ips" ,
71- Help : "Pending programming IP count ." ,
71+ Help : "IPs reserved but not yet available (Pending Programming) ." ,
7272 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
7373 },
7474 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
7575 )
7676 ipamPendingReleaseIPCount = prometheus .NewGaugeVec (
7777 prometheus.GaugeOpts {
7878 Name : "cx_ipam_pending_release_ips" ,
79- Help : "Pending release IP count ." ,
79+ Help : "IPs reserved but not available anymore (Pending Release) ." ,
8080 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
8181 },
8282 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
8383 )
8484 ipamPrimaryIPCount = prometheus .NewGaugeVec (
8585 prometheus.GaugeOpts {
8686 Name : "cx_ipam_primary_ips" ,
87- Help : "NC Primary IP count." ,
87+ Help : "NC Primary IP count (reserved from Pod Subnet for DNS and IMDS SNAT) ." ,
8888 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
8989 },
9090 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
9191 )
9292 ipamRequestedIPConfigCount = prometheus .NewGaugeVec (
9393 prometheus.GaugeOpts {
9494 Name : "cx_ipam_requested_ips" ,
95- Help : "Requested IP count ." ,
95+ Help : "Secondary Pod Subnet IPs requested by this CNS Node (for Pods) ." ,
9696 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
9797 },
9898 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
9999 )
100- ipamTotalIPCount = prometheus .NewGaugeVec (
100+ ipamSecondaryIPCount = prometheus .NewGaugeVec (
101101 prometheus.GaugeOpts {
102- Name : "cx_ipam_total_ips " ,
103- Help : "Count of total IP pool size allocated to CNS by DNC ." ,
102+ Name : "cx_ipam_secondary_ips " ,
103+ Help : "Node NC Secondary IP count (reserved usable by Pods) ." ,
104104 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
105105 },
106106 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
107107 )
108+ ipamSubnetExhaustionCount = prometheus .NewCounterVec (
109+ prometheus.CounterOpts {
110+ Name : "cx_ipam_subnet_exhaustion_state_count_total" ,
111+ Help : "Count of the number of times the ipam pool monitor sees subnet exhaustion" ,
112+ },
113+ []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel , subnetExhaustionStateLabel },
114+ )
108115 ipamSubnetExhaustionState = prometheus .NewGaugeVec (
109116 prometheus.GaugeOpts {
110117 Name : "cx_ipam_subnet_exhaustion_state" ,
111- Help : "IPAM view of subnet exhaustion state" ,
118+ Help : "CNS view of subnet exhaustion state" ,
112119 ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
113120 },
114121 []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
115122 )
116- ipamSubnetExhaustionCount = prometheus .NewCounterVec (
117- prometheus.CounterOpts {
118- Name : "cx_ipam_subnet_exhaustion_state_count_total" ,
119- Help : "Count of the number of times the ipam pool monitor sees subnet exhaustion" ,
123+ ipamTotalIPCount = prometheus .NewGaugeVec (
124+ prometheus.GaugeOpts {
125+ Name : "cx_ipam_total_ips" ,
126+ Help : "Total IPs reserved from the Pod Subnet by this Node." ,
127+ ConstLabels : prometheus.Labels {customerMetricLabel : customerMetricLabelValue },
120128 },
121- []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel , subnetExhaustionStateLabel },
129+ []string {subnetLabel , subnetCIDRLabel , podnetARMIDLabel },
122130 )
123131)
124132
@@ -134,9 +142,10 @@ func init() {
134142 ipamPendingReleaseIPCount ,
135143 ipamPrimaryIPCount ,
136144 ipamRequestedIPConfigCount ,
137- ipamTotalIPCount ,
138- ipamSubnetExhaustionState ,
145+ ipamSecondaryIPCount ,
139146 ipamSubnetExhaustionCount ,
147+ ipamSubnetExhaustionState ,
148+ ipamTotalIPCount ,
140149 )
141150}
142151
@@ -152,7 +161,8 @@ func observeIPPoolState(state ipPoolState, meta metaState) {
152161 ipamPendingReleaseIPCount .WithLabelValues (labels ... ).Set (float64 (state .pendingRelease ))
153162 ipamPrimaryIPCount .WithLabelValues (labels ... ).Set (float64 (len (meta .primaryIPAddresses )))
154163 ipamRequestedIPConfigCount .WithLabelValues (labels ... ).Set (float64 (state .requestedIPs ))
155- ipamTotalIPCount .WithLabelValues (labels ... ).Set (float64 (state .totalIPs ))
164+ ipamSecondaryIPCount .WithLabelValues (labels ... ).Set (float64 (state .secondaryIPs ))
165+ ipamTotalIPCount .WithLabelValues (labels ... ).Set (float64 (state .secondaryIPs + int64 (len (meta .primaryIPAddresses ))))
156166 if meta .exhausted {
157167 ipamSubnetExhaustionState .WithLabelValues (labels ... ).Set (float64 (subnetIPExhausted ))
158168 } else {
0 commit comments