diff --git a/docs/ingressclass-metrics.md b/docs/ingressclass-metrics.md index 1be511d350..f9fade6171 100644 --- a/docs/ingressclass-metrics.md +++ b/docs/ingressclass-metrics.md @@ -3,6 +3,6 @@ | Metric name| Metric type | Labels/tags | Status | | ---------- | ----------- | ----------- | ----------- | | kube_ingressclass_annotations | Gauge | `ingressclass`=<ingressclass-name>
`annotation_INGRESSCLASS_ANNOTATION`=<INGRESSCLASS_ANNOTATION> | EXPERIMENTAL | -| kube_ingressclass_info | Gauge | `ingressclass`=<ingressclass-name>
`controller`=<ingress-controller-name>
| STABLE | -| kube_ingressclass_labels | Gauge | `ingressclass`=<ingressclass-name>
`label_INGRESSCLASS_LABEL`=<INGRESSCLASS_LABEL> | STABLE | -| kube_ingressclass_created | Gauge | `ingressclass`=<ingressclass-name> | STABLE | +| kube_ingressclass_info | Gauge | `ingressclass`=<ingressclass-name>
`controller`=<ingress-controller-name>
| EXPERIMENTAL | +| kube_ingressclass_labels | Gauge | `ingressclass`=<ingressclass-name>
`label_INGRESSCLASS_LABEL`=<INGRESSCLASS_LABEL> | EXPERIMENTAL| +| kube_ingressclass_created | Gauge | `ingressclass`=<ingressclass-name> | EXPERIMENTAL| diff --git a/internal/store/ingressclass.go b/internal/store/ingressclass.go index f86a3180d3..9a433c3c22 100644 --- a/internal/store/ingressclass.go +++ b/internal/store/ingressclass.go @@ -16,6 +16,7 @@ package store import ( "context" + basemetrics "k8s.io/component-base/metrics" "k8s.io/kube-state-metrics/v2/pkg/metric" generator "k8s.io/kube-state-metrics/v2/pkg/metric_generator" @@ -37,10 +38,11 @@ var ( func ingressClassMetricFamilies(allowAnnotationsList, allowLabelsList []string) []generator.FamilyGenerator { return []generator.FamilyGenerator{ - *generator.NewFamilyGenerator( + *generator.NewFamilyGeneratorWithStability( "kube_ingressclass_info", "Information about ingressclass.", metric.Gauge, + basemetrics.ALPHA, "", wrapIngressClassFunc(func(s *networkingv1.IngressClass) *metric.Family { @@ -52,10 +54,11 @@ func ingressClassMetricFamilies(allowAnnotationsList, allowLabelsList []string) return &metric.Family{Metrics: []*metric.Metric{&m}} }), ), - *generator.NewFamilyGenerator( + *generator.NewFamilyGeneratorWithStability( "kube_ingressclass_created", "Unix creation timestamp", metric.Gauge, + basemetrics.ALPHA, "", wrapIngressClassFunc(func(s *networkingv1.IngressClass) *metric.Family { ms := []*metric.Metric{} @@ -69,10 +72,11 @@ func ingressClassMetricFamilies(allowAnnotationsList, allowLabelsList []string) } }), ), - *generator.NewFamilyGenerator( + *generator.NewFamilyGeneratorWithStability( descIngressClassAnnotationsName, descIngressClassAnnotationsHelp, metric.Gauge, + basemetrics.ALPHA, "", wrapIngressClassFunc(func(s *networkingv1.IngressClass) *metric.Family { annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", s.Annotations, allowAnnotationsList) @@ -87,10 +91,11 @@ func ingressClassMetricFamilies(allowAnnotationsList, allowLabelsList []string) } }), ), - *generator.NewFamilyGenerator( + *generator.NewFamilyGeneratorWithStability( descIngressClassLabelsName, descIngressClassLabelsHelp, metric.Gauge, + basemetrics.ALPHA, "", wrapIngressClassFunc(func(s *networkingv1.IngressClass) *metric.Family { labelKeys, labelValues := createPrometheusLabelKeysValues("label", s.Labels, allowLabelsList)