@@ -29,6 +29,7 @@ import (
2929 "k8s.io/apimachinery/pkg/watch"
3030 clientset "k8s.io/client-go/kubernetes"
3131 "k8s.io/client-go/tools/cache"
32+ basemetrics "k8s.io/component-base/metrics"
3233
3334 "k8s.io/kube-state-metrics/v2/pkg/metric"
3435 generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator"
@@ -62,10 +63,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
6263 }
6364 }),
6465 ),
65- * generator .NewFamilyGenerator (
66+ * generator .NewFamilyGeneratorWithStability (
6667 descCronJobLabelsName ,
6768 descCronJobLabelsHelp ,
6869 metric .Gauge ,
70+ basemetrics .STABLE ,
6971 "" ,
7072 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
7173 labelKeys , labelValues := createPrometheusLabelKeysValues ("label" , j .Labels , allowLabelsList )
@@ -80,10 +82,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
8082 }
8183 }),
8284 ),
83- * generator .NewFamilyGenerator (
85+ * generator .NewFamilyGeneratorWithStability (
8486 "kube_cronjob_info" ,
8587 "Info about cronjob." ,
8688 metric .Gauge ,
89+ basemetrics .STABLE ,
8790 "" ,
8891 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
8992 return & metric.Family {
@@ -97,10 +100,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
97100 }
98101 }),
99102 ),
100- * generator .NewFamilyGenerator (
103+ * generator .NewFamilyGeneratorWithStability (
101104 "kube_cronjob_created" ,
102105 "Unix creation timestamp" ,
103106 metric .Gauge ,
107+ basemetrics .STABLE ,
104108 "" ,
105109 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
106110 ms := []* metric.Metric {}
@@ -117,10 +121,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
117121 }
118122 }),
119123 ),
120- * generator .NewFamilyGenerator (
124+ * generator .NewFamilyGeneratorWithStability (
121125 "kube_cronjob_status_active" ,
122126 "Active holds pointers to currently running jobs." ,
123127 metric .Gauge ,
128+ basemetrics .STABLE ,
124129 "" ,
125130 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
126131 return & metric.Family {
@@ -134,10 +139,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
134139 }
135140 }),
136141 ),
137- * generator .NewFamilyGenerator (
142+ * generator .NewFamilyGeneratorWithStability (
138143 "kube_cronjob_status_last_schedule_time" ,
139144 "LastScheduleTime keeps information of when was the last time the job was successfully scheduled." ,
140145 metric .Gauge ,
146+ basemetrics .STABLE ,
141147 "" ,
142148 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
143149 ms := []* metric.Metric {}
@@ -176,10 +182,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
176182 }
177183 }),
178184 ),
179- * generator .NewFamilyGenerator (
185+ * generator .NewFamilyGeneratorWithStability (
180186 "kube_cronjob_spec_suspend" ,
181187 "Suspend flag tells the controller to suspend subsequent executions." ,
182188 metric .Gauge ,
189+ basemetrics .STABLE ,
183190 "" ,
184191 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
185192 ms := []* metric.Metric {}
@@ -197,10 +204,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
197204 }
198205 }),
199206 ),
200- * generator .NewFamilyGenerator (
207+ * generator .NewFamilyGeneratorWithStability (
201208 "kube_cronjob_spec_starting_deadline_seconds" ,
202209 "Deadline in seconds for starting the job if it misses scheduled time for any reason." ,
203210 metric .Gauge ,
211+ basemetrics .STABLE ,
204212 "" ,
205213 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
206214 ms := []* metric.Metric {}
@@ -219,10 +227,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
219227 }
220228 }),
221229 ),
222- * generator .NewFamilyGenerator (
230+ * generator .NewFamilyGeneratorWithStability (
223231 "kube_cronjob_next_schedule_time" ,
224232 "Next time the cronjob should be scheduled. The time after lastScheduleTime, or after the cron job's creation time if it's never been scheduled. Use this to determine if the job is delayed." ,
225233 metric .Gauge ,
234+ basemetrics .STABLE ,
226235 "" ,
227236 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
228237 ms := []* metric.Metric {}
@@ -244,10 +253,11 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
244253 }
245254 }),
246255 ),
247- * generator .NewFamilyGenerator (
256+ * generator .NewFamilyGeneratorWithStability (
248257 "kube_cronjob_metadata_resource_version" ,
249258 "Resource version representing a specific version of the cronjob." ,
250259 metric .Gauge ,
260+ basemetrics .STABLE ,
251261 "" ,
252262 wrapCronJobFunc (func (j * batchv1.CronJob ) * metric.Family {
253263 return & metric.Family {
0 commit comments