mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #83837 from RainbowMango/pr_hide_apiserver_deprecated_metrics
Turn off apiserver deprecated metrics
This commit is contained in:
commit
beaf3a2f04
@ -77,8 +77,9 @@ var (
|
|||||||
deprecatedRequestCounter = compbasemetrics.NewCounterVec(
|
deprecatedRequestCounter = compbasemetrics.NewCounterVec(
|
||||||
&compbasemetrics.CounterOpts{
|
&compbasemetrics.CounterOpts{
|
||||||
Name: "apiserver_request_count",
|
Name: "apiserver_request_count",
|
||||||
Help: "(Deprecated) Counter of apiserver requests broken out for each verb, group, version, resource, scope, component, client, and HTTP response contentType and code.",
|
Help: "Counter of apiserver requests broken out for each verb, group, version, resource, scope, component, client, and HTTP response contentType and code.",
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component", "client", "contentType", "code"},
|
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component", "client", "contentType", "code"},
|
||||||
)
|
)
|
||||||
@ -106,21 +107,23 @@ var (
|
|||||||
deprecatedRequestLatencies = compbasemetrics.NewHistogramVec(
|
deprecatedRequestLatencies = compbasemetrics.NewHistogramVec(
|
||||||
&compbasemetrics.HistogramOpts{
|
&compbasemetrics.HistogramOpts{
|
||||||
Name: "apiserver_request_latencies",
|
Name: "apiserver_request_latencies",
|
||||||
Help: "(Deprecated) Response latency distribution in microseconds for each verb, group, version, resource, subresource, scope and component.",
|
Help: "Response latency distribution in microseconds for each verb, group, version, resource, subresource, scope and component.",
|
||||||
// Use buckets ranging from 125 ms to 8 seconds.
|
// Use buckets ranging from 125 ms to 8 seconds.
|
||||||
Buckets: compbasemetrics.ExponentialBuckets(125000, 2.0, 7),
|
Buckets: compbasemetrics.ExponentialBuckets(125000, 2.0, 7),
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component"},
|
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component"},
|
||||||
)
|
)
|
||||||
deprecatedRequestLatenciesSummary = compbasemetrics.NewSummaryVec(
|
deprecatedRequestLatenciesSummary = compbasemetrics.NewSummaryVec(
|
||||||
&compbasemetrics.SummaryOpts{
|
&compbasemetrics.SummaryOpts{
|
||||||
Name: "apiserver_request_latencies_summary",
|
Name: "apiserver_request_latencies_summary",
|
||||||
Help: "(Deprecated) Response latency summary in microseconds for each verb, group, version, resource, subresource, scope and component.",
|
Help: "Response latency summary in microseconds for each verb, group, version, resource, subresource, scope and component.",
|
||||||
// Make the sliding window of 5h.
|
// Make the sliding window of 5h.
|
||||||
// TODO: The value for this should be based on our SLI definition (medium term).
|
// TODO: The value for this should be based on our SLI definition (medium term).
|
||||||
MaxAge: 5 * time.Hour,
|
MaxAge: 5 * time.Hour,
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component"},
|
[]string{"verb", "group", "version", "resource", "subresource", "scope", "component"},
|
||||||
)
|
)
|
||||||
@ -146,8 +149,9 @@ var (
|
|||||||
DeprecatedDroppedRequests = compbasemetrics.NewCounterVec(
|
DeprecatedDroppedRequests = compbasemetrics.NewCounterVec(
|
||||||
&compbasemetrics.CounterOpts{
|
&compbasemetrics.CounterOpts{
|
||||||
Name: "apiserver_dropped_requests",
|
Name: "apiserver_dropped_requests",
|
||||||
Help: "(Deprecated) Number of requests dropped with 'Try again later' response",
|
Help: "Number of requests dropped with 'Try again later' response",
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"requestKind"},
|
[]string{"requestKind"},
|
||||||
)
|
)
|
||||||
|
@ -53,8 +53,9 @@ var (
|
|||||||
deprecatedEtcdRequestLatenciesSummary = compbasemetrics.NewSummaryVec(
|
deprecatedEtcdRequestLatenciesSummary = compbasemetrics.NewSummaryVec(
|
||||||
&compbasemetrics.SummaryOpts{
|
&compbasemetrics.SummaryOpts{
|
||||||
Name: "etcd_request_latencies_summary",
|
Name: "etcd_request_latencies_summary",
|
||||||
Help: "(Deprecated) Etcd request latency summary in microseconds for each operation and object type.",
|
Help: "Etcd request latency summary in microseconds for each operation and object type.",
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
StabilityLevel: compbasemetrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"operation", "type"},
|
[]string{"operation", "type"},
|
||||||
)
|
)
|
||||||
|
@ -58,11 +58,12 @@ var (
|
|||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "transformation_latencies_microseconds",
|
Name: "transformation_latencies_microseconds",
|
||||||
Help: "(Deprecated) Latencies in microseconds of value transformation operations.",
|
Help: "Latencies in microseconds of value transformation operations.",
|
||||||
// In-process transformations (ex. AES CBC) complete on the order of 20 microseconds. However, when
|
// In-process transformations (ex. AES CBC) complete on the order of 20 microseconds. However, when
|
||||||
// external KMS is involved latencies may climb into milliseconds.
|
// external KMS is involved latencies may climb into milliseconds.
|
||||||
Buckets: metrics.ExponentialBuckets(5, 2, 14),
|
Buckets: metrics.ExponentialBuckets(5, 2, 14),
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
[]string{"transformation_type"},
|
[]string{"transformation_type"},
|
||||||
)
|
)
|
||||||
@ -83,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"},
|
||||||
)
|
)
|
||||||
@ -114,9 +116,10 @@ var (
|
|||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "data_key_generation_latencies_microseconds",
|
Name: "data_key_generation_latencies_microseconds",
|
||||||
Help: "(Deprecated) Latencies in microseconds of data encryption key(DEK) generation operations.",
|
Help: "Latencies in microseconds of data encryption key(DEK) generation operations.",
|
||||||
Buckets: metrics.ExponentialBuckets(5, 2, 14),
|
Buckets: metrics.ExponentialBuckets(5, 2, 14),
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
|
DeprecatedVersion: "1.14.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
dataKeyGenerationFailuresTotal = metrics.NewCounter(
|
dataKeyGenerationFailuresTotal = metrics.NewCounter(
|
||||||
|
@ -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
|
||||||
|
@ -18,9 +18,7 @@ package metrics
|
|||||||
|
|
||||||
var interestingAPIServerMetrics = []string{
|
var interestingAPIServerMetrics = []string{
|
||||||
"apiserver_request_total",
|
"apiserver_request_total",
|
||||||
// TODO(krzysied): apiserver_request_latencies_summary is a deprecated metric.
|
"apiserver_request_latency_seconds",
|
||||||
// It should be replaced with new metric.
|
|
||||||
"apiserver_request_latencies_summary",
|
|
||||||
"apiserver_init_events_total",
|
"apiserver_init_events_total",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user