Skip to content

Commit

Permalink
add stability experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitoii11 committed Nov 23, 2022
1 parent 2784269 commit 07af191
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/ingressclass-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_ingressclass_annotations | Gauge | `ingressclass`=&lt;ingressclass-name&gt; <br> `annotation_INGRESSCLASS_ANNOTATION`=&lt;INGRESSCLASS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_ingressclass_info | Gauge | `ingressclass`=&lt;ingressclass-name&gt; <br> `controller`=&lt;ingress-controller-name&gt; <br> | STABLE |
| kube_ingressclass_labels | Gauge | `ingressclass`=&lt;ingressclass-name&gt; <br> `label_INGRESSCLASS_LABEL`=&lt;INGRESSCLASS_LABEL&gt; | STABLE |
| kube_ingressclass_created | Gauge | `ingressclass`=&lt;ingressclass-name&gt; | STABLE |
| kube_ingressclass_info | Gauge | `ingressclass`=&lt;ingressclass-name&gt; <br> `controller`=&lt;ingress-controller-name&gt; <br> | EXPERIMENTAL |
| kube_ingressclass_labels | Gauge | `ingressclass`=&lt;ingressclass-name&gt; <br> `label_INGRESSCLASS_LABEL`=&lt;INGRESSCLASS_LABEL&gt; | EXPERIMENTAL|
| kube_ingressclass_created | Gauge | `ingressclass`=&lt;ingressclass-name&gt; | EXPERIMENTAL|
13 changes: 9 additions & 4 deletions internal/store/ingressclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 {

Expand All @@ -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{}
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 07af191

Please sign in to comment.