Hide apiserver metrics that have been deprecated in 1.15

Kubernetes-commit: 627a9abc9edb2b06c3b30e53ccd422e15c1f6ea1
This commit is contained in:
RainbowMango 2019-10-12 21:17:01 +08:00 committed by Kubernetes Publisher
parent de8c866328
commit 5f15b07078
2 changed files with 26 additions and 41 deletions

View File

@ -84,8 +84,9 @@ var (
Namespace: namespace, Namespace: namespace,
Subsystem: subsystem, Subsystem: subsystem,
Name: "transformation_failures_total", Name: "transformation_failures_total",
Help: "(Deprecated) Total number of failed transformation operations.", Help: "Total number of failed transformation operations.",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.15.0",
}, },
[]string{"transformation_type"}, []string{"transformation_type"},
) )

View File

@ -48,13 +48,8 @@ func TestTotals(t *testing.T) {
prefix: NewPrefixTransformers(nil, nonStatusErrTransformer), prefix: NewPrefixTransformers(nil, nonStatusErrTransformer),
metrics: []string{ metrics: []string{
"apiserver_storage_transformation_operations_total", "apiserver_storage_transformation_operations_total",
"apiserver_storage_transformation_failures_total",
}, },
want: ` want: `
# HELP apiserver_storage_transformation_failures_total [ALPHA] (Deprecated) Total number of failed transformation operations.
# TYPE apiserver_storage_transformation_failures_total counter
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations. # HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
# TYPE apiserver_storage_transformation_operations_total counter # TYPE apiserver_storage_transformation_operations_total counter
apiserver_storage_transformation_operations_total{status="Unknown",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1 apiserver_storage_transformation_operations_total{status="Unknown",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
@ -66,7 +61,6 @@ apiserver_storage_transformation_operations_total{status="Unknown",transformatio
prefix: NewPrefixTransformers(nil, okTransformer), prefix: NewPrefixTransformers(nil, okTransformer),
metrics: []string{ metrics: []string{
"apiserver_storage_transformation_operations_total", "apiserver_storage_transformation_operations_total",
"apiserver_storage_transformation_failures_total",
}, },
want: ` want: `
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations. # HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
@ -80,13 +74,8 @@ apiserver_storage_transformation_operations_total{status="OK",transformation_typ
prefix: NewPrefixTransformers(nil, failedPreconditionErrTransformer), prefix: NewPrefixTransformers(nil, failedPreconditionErrTransformer),
metrics: []string{ metrics: []string{
"apiserver_storage_transformation_operations_total", "apiserver_storage_transformation_operations_total",
"apiserver_storage_transformation_failures_total",
}, },
want: ` want: `
# HELP apiserver_storage_transformation_failures_total [ALPHA] (Deprecated) Total number of failed transformation operations.
# TYPE apiserver_storage_transformation_failures_total counter
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations. # HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
# TYPE apiserver_storage_transformation_operations_total counter # TYPE apiserver_storage_transformation_operations_total counter
apiserver_storage_transformation_operations_total{status="FailedPrecondition",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1 apiserver_storage_transformation_operations_total{status="FailedPrecondition",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
@ -98,13 +87,8 @@ apiserver_storage_transformation_operations_total{status="FailedPrecondition",tr
prefix: NewPrefixTransformers(nil, internalErrTransformer), prefix: NewPrefixTransformers(nil, internalErrTransformer),
metrics: []string{ metrics: []string{
"apiserver_storage_transformation_operations_total", "apiserver_storage_transformation_operations_total",
"apiserver_storage_transformation_failures_total",
}, },
want: ` want: `
# HELP apiserver_storage_transformation_failures_total [ALPHA] (Deprecated) Total number of failed transformation operations.
# TYPE apiserver_storage_transformation_failures_total counter
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations. # HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
# TYPE apiserver_storage_transformation_operations_total counter # TYPE apiserver_storage_transformation_operations_total counter
apiserver_storage_transformation_operations_total{status="Internal",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1 apiserver_storage_transformation_operations_total{status="Internal",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1