Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable labels and annotations metrics when metric-annotations-… #2145

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/store/certificatesigningrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func csrMetricFamilies(allowAnnotationsList, allowLabelsList []string) []generat
basemetrics.ALPHA,
"",
wrapCSRFunc(func(j *certv1.CertificateSigningRequest) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", j.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -68,6 +71,9 @@ func csrMetricFamilies(allowAnnotationsList, allowLabelsList []string) []generat
basemetrics.STABLE,
"",
wrapCSRFunc(func(j *certv1.CertificateSigningRequest) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", j.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
6 changes: 0 additions & 6 deletions internal/store/certificatesigningrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 0
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 0
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 0
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down Expand Up @@ -87,7 +86,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 0
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 1
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 0
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down Expand Up @@ -117,7 +115,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 1
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 0
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 0
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down Expand Up @@ -148,7 +145,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 1
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 0
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 13
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down Expand Up @@ -181,7 +177,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 1
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 1
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 0
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down Expand Up @@ -220,7 +215,6 @@ func TestCsrStore(t *testing.T) {
kube_certificatesigningrequest_created{certificatesigningrequest="certificate-test",signer_name="signer"} 1.5e+09
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="approved"} 2
kube_certificatesigningrequest_condition{certificatesigningrequest="certificate-test",signer_name="signer",condition="denied"} 2
kube_certificatesigningrequest_labels{certificatesigningrequest="certificate-test",signer_name="signer"} 1
kube_certificatesigningrequest_cert_length{certificatesigningrequest="certificate-test",signer_name="signer"} 0
`,
MetricNames: []string{"kube_certificatesigningrequest_created", "kube_certificatesigningrequest_condition", "kube_certificatesigningrequest_labels", "kube_certificatesigningrequest_cert_length"},
Expand Down
6 changes: 6 additions & 0 deletions internal/store/clusterrole.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func clusterRoleMetricFamilies(allowAnnotationsList, allowLabelsList []string) [
basemetrics.ALPHA,
"",
wrapClusterRoleFunc(func(r *rbacv1.ClusterRole) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", r.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -67,6 +70,9 @@ func clusterRoleMetricFamilies(allowAnnotationsList, allowLabelsList []string) [
basemetrics.ALPHA,
"",
wrapClusterRoleFunc(func(r *rbacv1.ClusterRole) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", r.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
6 changes: 6 additions & 0 deletions internal/store/clusterrolebinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func clusterRoleBindingMetricFamilies(allowAnnotationsList, allowLabelsList []st
basemetrics.ALPHA,
"",
wrapClusterRoleBindingFunc(func(r *rbacv1.ClusterRoleBinding) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", r.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -67,6 +70,9 @@ func clusterRoleBindingMetricFamilies(allowAnnotationsList, allowLabelsList []st
basemetrics.ALPHA,
"",
wrapClusterRoleBindingFunc(func(r *rbacv1.ClusterRoleBinding) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", r.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
6 changes: 6 additions & 0 deletions internal/store/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func configMapMetricFamilies(allowAnnotationsList, allowLabelsList []string) []g
basemetrics.ALPHA,
"",
wrapConfigMapFunc(func(c *v1.ConfigMap) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", c.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -63,6 +66,9 @@ func configMapMetricFamilies(allowAnnotationsList, allowLabelsList []string) []g
basemetrics.STABLE,
"",
wrapConfigMapFunc(func(c *v1.ConfigMap) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", c.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
6 changes: 6 additions & 0 deletions internal/store/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
basemetrics.ALPHA,
"",
wrapCronJobFunc(func(j *batchv1.CronJob) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", j.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -71,6 +74,9 @@ func cronJobMetricFamilies(allowAnnotationsList, allowLabelsList []string) []gen
basemetrics.STABLE,
"",
wrapCronJobFunc(func(j *batchv1.CronJob) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", j.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
4 changes: 0 additions & 4 deletions internal/store/cronjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func TestCronJobStore(t *testing.T) {
# TYPE kube_cronjob_status_last_schedule_time gauge
kube_cronjob_info{concurrency_policy="Forbid",cronjob="ActiveRunningCronJob1",namespace="ns1",schedule="0 */6 * * *"} 1
kube_cronjob_annotations{annotation_app_k8s_io_owner="@foo",cronjob="ActiveRunningCronJob1",namespace="ns1"} 1
kube_cronjob_labels{cronjob="ActiveRunningCronJob1",namespace="ns1"} 1
kube_cronjob_spec_failed_job_history_limit{cronjob="ActiveRunningCronJob1",namespace="ns1"} 1
kube_cronjob_spec_starting_deadline_seconds{cronjob="ActiveRunningCronJob1",namespace="ns1"} 300
kube_cronjob_spec_successful_job_history_limit{cronjob="ActiveRunningCronJob1",namespace="ns1"} 3
Expand Down Expand Up @@ -235,7 +234,6 @@ func TestCronJobStore(t *testing.T) {
# TYPE kube_cronjob_status_last_schedule_time gauge
# TYPE kube_cronjob_status_last_successful_time gauge
kube_cronjob_info{concurrency_policy="Forbid",cronjob="SuspendedCronJob1",namespace="ns1",schedule="0 */3 * * *"} 1
kube_cronjob_labels{cronjob="SuspendedCronJob1",namespace="ns1"} 1
kube_cronjob_spec_failed_job_history_limit{cronjob="SuspendedCronJob1",namespace="ns1"} 1
kube_cronjob_spec_starting_deadline_seconds{cronjob="SuspendedCronJob1",namespace="ns1"} 300
kube_cronjob_spec_successful_job_history_limit{cronjob="SuspendedCronJob1",namespace="ns1"} 3
Expand Down Expand Up @@ -295,7 +293,6 @@ func TestCronJobStore(t *testing.T) {
# TYPE kube_cronjob_status_last_schedule_time gauge
# TYPE kube_cronjob_status_last_successful_time gauge
kube_cronjob_info{concurrency_policy="Forbid",cronjob="SuspendedCronJob1",namespace="ns1",schedule="0 */3 * * *"} 1
kube_cronjob_labels{cronjob="SuspendedCronJob1",namespace="ns1"} 1
kube_cronjob_spec_failed_job_history_limit{cronjob="SuspendedCronJob1",namespace="ns1"} 1
kube_cronjob_spec_starting_deadline_seconds{cronjob="SuspendedCronJob1",namespace="ns1"} 300
kube_cronjob_spec_successful_job_history_limit{cronjob="SuspendedCronJob1",namespace="ns1"} 3
Expand Down Expand Up @@ -364,7 +361,6 @@ func TestCronJobStore(t *testing.T) {
kube_cronjob_spec_suspend{cronjob="ActiveCronJob1NoLastScheduled",namespace="ns1"} 0
kube_cronjob_info{concurrency_policy="Forbid",cronjob="ActiveCronJob1NoLastScheduled",namespace="ns1",schedule="25 * * * *"} 1
kube_cronjob_created{cronjob="ActiveCronJob1NoLastScheduled",namespace="ns1"} 1.520766296e+09
kube_cronjob_labels{cronjob="ActiveCronJob1NoLastScheduled",namespace="ns1"} 1
` +
fmt.Sprintf("kube_cronjob_next_schedule_time{cronjob=\"ActiveCronJob1NoLastScheduled\",namespace=\"ns1\"} %ve+09\n",
float64(ActiveCronJob1NoLastScheduledNextScheduleTime.Unix())/math.Pow10(9)),
Expand Down
6 changes: 6 additions & 0 deletions internal/store/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ func daemonSetMetricFamilies(allowAnnotationsList, allowLabelsList []string) []g
basemetrics.ALPHA,
"",
wrapDaemonSetFunc(func(d *v1.DaemonSet) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", d.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -249,6 +252,9 @@ func daemonSetMetricFamilies(allowAnnotationsList, allowLabelsList []string) []g
basemetrics.STABLE,
"",
wrapDaemonSetFunc(func(d *v1.DaemonSet) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", d.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
3 changes: 0 additions & 3 deletions internal/store/daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func TestDaemonSetStore(t *testing.T) {
kube_daemonset_status_observed_generation{daemonset="ds1",namespace="ns1"} 2
kube_daemonset_status_updated_number_scheduled{daemonset="ds1",namespace="ns1"} 0
kube_daemonset_annotations{annotation_app_k8s_io_owner="@foo",daemonset="ds1",namespace="ns1"} 1
kube_daemonset_labels{daemonset="ds1",namespace="ns1"} 1
`,
MetricNames: []string{
"kube_daemonset_annotations",
Expand Down Expand Up @@ -149,7 +148,6 @@ func TestDaemonSetStore(t *testing.T) {
kube_daemonset_status_number_ready{daemonset="ds2",namespace="ns2"} 0
kube_daemonset_status_number_unavailable{daemonset="ds2",namespace="ns2"} 0
kube_daemonset_status_updated_number_scheduled{daemonset="ds2",namespace="ns2"} 0
kube_daemonset_labels{daemonset="ds2",namespace="ns2"} 1
kube_daemonset_created{namespace="ns2",daemonset="ds2"} 1.5e+09
`,
MetricNames: []string{
Expand Down Expand Up @@ -216,7 +214,6 @@ func TestDaemonSetStore(t *testing.T) {
kube_daemonset_status_number_ready{daemonset="ds3",namespace="ns3"} 5
kube_daemonset_status_number_unavailable{daemonset="ds3",namespace="ns3"} 5
kube_daemonset_status_updated_number_scheduled{daemonset="ds3",namespace="ns3"} 5
kube_daemonset_labels{daemonset="ds3",namespace="ns3"} 1
`,
MetricNames: []string{
"kube_daemonset_created",
Expand Down
6 changes: 6 additions & 0 deletions internal/store/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ func deploymentMetricFamilies(allowAnnotationsList, allowLabelsList []string) []
basemetrics.ALPHA,
"",
wrapDeploymentFunc(func(d *v1.Deployment) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", d.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -309,6 +312,9 @@ func deploymentMetricFamilies(allowAnnotationsList, allowLabelsList []string) []
basemetrics.STABLE,
"",
wrapDeploymentFunc(func(d *v1.Deployment) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", d.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
3 changes: 0 additions & 3 deletions internal/store/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func TestDeploymentStore(t *testing.T) {
Want: metadata + `
kube_deployment_annotations{annotation_company_io_team="my-brilliant-team",deployment="depl1",namespace="ns1"} 1
kube_deployment_created{deployment="depl1",namespace="ns1"} 1.5e+09
kube_deployment_labels{deployment="depl1",namespace="ns1"} 1
kube_deployment_metadata_generation{deployment="depl1",namespace="ns1"} 21
kube_deployment_spec_paused{deployment="depl1",namespace="ns1"} 0
kube_deployment_spec_replicas{deployment="depl1",namespace="ns1"} 200
Expand Down Expand Up @@ -170,8 +169,6 @@ func TestDeploymentStore(t *testing.T) {
},
},
Want: metadata + `
kube_deployment_annotations{deployment="depl2",namespace="ns2"} 1
kube_deployment_labels{deployment="depl2",namespace="ns2"} 1
kube_deployment_metadata_generation{deployment="depl2",namespace="ns2"} 14
kube_deployment_spec_paused{deployment="depl2",namespace="ns2"} 1
kube_deployment_spec_replicas{deployment="depl2",namespace="ns2"} 5
Expand Down
6 changes: 6 additions & 0 deletions internal/store/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge
basemetrics.ALPHA,
"",
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", e.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -105,6 +108,9 @@ func endpointMetricFamilies(allowAnnotationsList, allowLabelsList []string) []ge
basemetrics.STABLE,
"",
wrapEndpointFunc(func(e *v1.Endpoints) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", e.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
4 changes: 0 additions & 4 deletions internal/store/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ func TestEndpointStore(t *testing.T) {
},
},
Want: metadata + `
kube_endpoint_annotations{endpoint="test-endpoint",namespace="default"} 1
kube_endpoint_address_available{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_address_not_ready{endpoint="test-endpoint",namespace="default"} 6
kube_endpoint_created{endpoint="test-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="test-endpoint",namespace="default"} 1
kube_endpoint_labels{endpoint="test-endpoint",namespace="default"} 1
kube_endpoint_ports{endpoint="test-endpoint",namespace="default",port_name="http",port_protocol="TCP",port_number="8080"} 1
kube_endpoint_ports{endpoint="test-endpoint",namespace="default",port_name="app",port_protocol="TCP",port_number="8081"} 1
kube_endpoint_ports{endpoint="test-endpoint",namespace="default",port_name="https",port_protocol="TCP",port_number="8443"} 1
Expand Down Expand Up @@ -134,12 +132,10 @@ func TestEndpointStore(t *testing.T) {
},
},
Want: metadata + `
kube_endpoint_annotations{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_address_available{endpoint="single-port-endpoint",namespace="default"} 2
kube_endpoint_address_not_ready{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_created{endpoint="single-port-endpoint",namespace="default"} 1.5e+09
kube_endpoint_info{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_labels{endpoint="single-port-endpoint",namespace="default"} 1
kube_endpoint_ports{endpoint="single-port-endpoint",namespace="default",port_name="",port_number="8080",port_protocol="TCP"} 1
kube_endpoint_address{endpoint="single-port-endpoint",namespace="default",ip="127.0.0.1",ready="true"} 1
kube_endpoint_address{endpoint="single-port-endpoint",namespace="default",ip="10.0.0.1",ready="true"} 1
Expand Down
6 changes: 6 additions & 0 deletions internal/store/endpointslice.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ func endpointSliceMetricFamilies(allowAnnotationsList, allowLabelsList []string)
basemetrics.ALPHA,
"",
wrapEndpointSliceFunc(func(s *discoveryv1.EndpointSlice) *metric.Family {
if len(allowAnnotationsList) == 0 {
return &metric.Family{}
}
annotationKeys, annotationValues := createPrometheusLabelKeysValues("annotation", s.Annotations, allowAnnotationsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand All @@ -193,6 +196,9 @@ func endpointSliceMetricFamilies(allowAnnotationsList, allowLabelsList []string)
basemetrics.ALPHA,
"",
wrapEndpointSliceFunc(func(s *discoveryv1.EndpointSlice) *metric.Family {
if len(allowLabelsList) == 0 {
return &metric.Family{}
}
labelKeys, labelValues := createPrometheusLabelKeysValues("label", s.Labels, allowLabelsList)
return &metric.Family{
Metrics: []*metric.Metric{
Expand Down
Loading