@@ -35,6 +35,7 @@ func TestHPAStore(t *testing.T) {
3535 // Fixed metadata on type and help text. We prepend this to every expected
3636 // output so we only have to modify a single place when doing adjustments.
3737 const metadata = `
38+ # HELP kube_horizontalpodautoscaler_info Information about this autoscaler.
3839 # HELP kube_horizontalpodautoscaler_annotations Kubernetes annotations converted to Prometheus labels.
3940 # HELP kube_horizontalpodautoscaler_labels Kubernetes labels converted to Prometheus labels.
4041 # HELP kube_horizontalpodautoscaler_metadata_generation The generation observed by the HorizontalPodAutoscaler controller.
@@ -44,6 +45,7 @@ func TestHPAStore(t *testing.T) {
4445 # HELP kube_horizontalpodautoscaler_status_condition The condition of this autoscaler.
4546 # HELP kube_horizontalpodautoscaler_status_current_replicas Current number of replicas of pods managed by this autoscaler.
4647 # HELP kube_horizontalpodautoscaler_status_desired_replicas Desired number of replicas of pods managed by this autoscaler.
48+ # TYPE kube_horizontalpodautoscaler_info gauge
4749 # TYPE kube_horizontalpodautoscaler_annotations gauge
4850 # TYPE kube_horizontalpodautoscaler_labels gauge
4951 # TYPE kube_horizontalpodautoscaler_metadata_generation gauge
@@ -183,6 +185,7 @@ func TestHPAStore(t *testing.T) {
183185 },
184186 },
185187 Want : metadata + `
188+ kube_horizontalpodautoscaler_info{horizontalpodautoscaler="hpa1",namespace="ns1",scaletargetref_api_version="apps/v1",scaletargetref_kind="Deployment",scaletargetref_name="deployment1"} 1
186189 kube_horizontalpodautoscaler_annotations{horizontalpodautoscaler="hpa1",namespace="ns1"} 1
187190 kube_horizontalpodautoscaler_labels{horizontalpodautoscaler="hpa1",namespace="ns1"} 1
188191 kube_horizontalpodautoscaler_metadata_generation{horizontalpodautoscaler="hpa1",namespace="ns1"} 2
@@ -203,6 +206,7 @@ func TestHPAStore(t *testing.T) {
203206 kube_horizontalpodautoscaler_status_desired_replicas{horizontalpodautoscaler="hpa1",namespace="ns1"} 2
204207 ` ,
205208 MetricNames : []string {
209+ "kube_horizontalpodautoscaler_info" ,
206210 "kube_horizontalpodautoscaler_metadata_generation" ,
207211 "kube_horizontalpodautoscaler_spec_max_replicas" ,
208212 "kube_horizontalpodautoscaler_spec_min_replicas" ,
@@ -278,9 +282,8 @@ func TestHPAStore(t *testing.T) {
278282 },
279283 },
280284 ScaleTargetRef : autoscaling.CrossVersionObjectReference {
281- APIVersion : "apps/v1" ,
282- Kind : "Deployment" ,
283- Name : "deployment1" ,
285+ Kind : "Deployment" ,
286+ Name : "deployment1" ,
284287 },
285288 },
286289 Status : autoscaling.HorizontalPodAutoscalerStatus {
@@ -341,6 +344,7 @@ func TestHPAStore(t *testing.T) {
341344 },
342345 },
343346 Want : metadata + `
347+ kube_horizontalpodautoscaler_info{horizontalpodautoscaler="hpa2",namespace="ns1",scaletargetref_kind="Deployment",scaletargetref_name="deployment1"} 1
344348 kube_horizontalpodautoscaler_annotations{annotation_app_k8s_io_owner="@foo",horizontalpodautoscaler="hpa2",namespace="ns1"} 1
345349 kube_horizontalpodautoscaler_labels{horizontalpodautoscaler="hpa2",namespace="ns1"} 1
346350 kube_horizontalpodautoscaler_metadata_generation{horizontalpodautoscaler="hpa2",namespace="ns1"} 2
@@ -357,6 +361,7 @@ func TestHPAStore(t *testing.T) {
357361 kube_horizontalpodautoscaler_status_desired_replicas{horizontalpodautoscaler="hpa2",namespace="ns1"} 2
358362 ` ,
359363 MetricNames : []string {
364+ "kube_horizontalpodautoscaler_info" ,
360365 "kube_horizontalpodautoscaler_metadata_generation" ,
361366 "kube_horizontalpodautoscaler_spec_max_replicas" ,
362367 "kube_horizontalpodautoscaler_spec_min_replicas" ,
0 commit comments