mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Hide apiserver metrics that have been deprecated in 1.15
This commit is contained in:
parent
5e0695e339
commit
627a9abc9e
@ -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"},
|
||||||
)
|
)
|
||||||
|
@ -48,68 +48,52 @@ 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.
|
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
||||||
# TYPE apiserver_storage_transformation_failures_total counter
|
# TYPE apiserver_storage_transformation_operations_total counter
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
|
apiserver_storage_transformation_operations_total{status="Unknown",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
|
apiserver_storage_transformation_operations_total{status="Unknown",transformation_type="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
`,
|
||||||
# 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="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "ok",
|
desc: "ok",
|
||||||
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.
|
||||||
# TYPE apiserver_storage_transformation_operations_total counter
|
# TYPE apiserver_storage_transformation_operations_total counter
|
||||||
apiserver_storage_transformation_operations_total{status="OK",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
apiserver_storage_transformation_operations_total{status="OK",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
apiserver_storage_transformation_operations_total{status="OK",transformation_type="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
apiserver_storage_transformation_operations_total{status="OK",transformation_type="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "failed precondition",
|
desc: "failed precondition",
|
||||||
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.
|
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
||||||
# TYPE apiserver_storage_transformation_failures_total counter
|
# TYPE apiserver_storage_transformation_operations_total counter
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
|
apiserver_storage_transformation_operations_total{status="FailedPrecondition",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
|
apiserver_storage_transformation_operations_total{status="FailedPrecondition",transformation_type="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
`,
|
||||||
# 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="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "internal",
|
desc: "internal",
|
||||||
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.
|
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
||||||
# TYPE apiserver_storage_transformation_failures_total counter
|
# TYPE apiserver_storage_transformation_operations_total counter
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="from_storage"} 1
|
apiserver_storage_transformation_operations_total{status="Internal",transformation_type="from_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
apiserver_storage_transformation_failures_total{transformation_type="to_storage"} 1
|
apiserver_storage_transformation_operations_total{status="Internal",transformation_type="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
||||||
# HELP apiserver_storage_transformation_operations_total [ALPHA] Total number of transformations.
|
`,
|
||||||
# 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="to_storage",transformer_prefix="k8s:enc:kms:v1:"} 1
|
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user