Merge pull request #114497 from dgrisonnet/pod-logs-metrics

Remove redundant subsystem in kube-apiserver pod logs metrics name

Kubernetes-commit: 94e30facdbe4d21234a07da0b7998b4b8a3b1414
This commit is contained in:
Kubernetes Publisher 2023-03-10 12:40:41 -08:00
commit a45b9813bc
3 changed files with 11 additions and 4 deletions

4
go.mod
View File

@ -43,7 +43,7 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.6.0
k8s.io/api v0.0.0-20230310084044-182afbd21219
k8s.io/apimachinery v0.0.0-20230310204501-66f7b8932364
k8s.io/apimachinery v0.0.0-20230310204503-273f86d1012f
k8s.io/client-go v0.0.0-20230310170151-6df09021f998
k8s.io/component-base v0.0.0-20230310085212-d69652187fff
k8s.io/klog/v2 v2.90.1
@ -125,7 +125,7 @@ require (
replace (
k8s.io/api => k8s.io/api v0.0.0-20230310084044-182afbd21219
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230310204501-66f7b8932364
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230310204503-273f86d1012f
k8s.io/client-go => k8s.io/client-go v0.0.0-20230310170151-6df09021f998
k8s.io/component-base => k8s.io/component-base v0.0.0-20230310085212-d69652187fff
k8s.io/kms => k8s.io/kms v0.0.0-20230304001132-5439f76ca4a7

4
go.sum
View File

@ -876,8 +876,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20230310084044-182afbd21219 h1:Zi16ywjzp2CqeHJZoz3N0RlFu20NqeuIzqY1RkRg4FU=
k8s.io/api v0.0.0-20230310084044-182afbd21219/go.mod h1:BufeAXF75avqFSWCYqXkvwYrwI4ZAem3uLWUZFS14hw=
k8s.io/apimachinery v0.0.0-20230310204501-66f7b8932364 h1:m+Uzv/sjNwVWhegSR0hoa2/THCkP7lVTjLsDj8kPFL8=
k8s.io/apimachinery v0.0.0-20230310204501-66f7b8932364/go.mod h1:RWA+8iKvi6iwtPZ0MMwtZSlZRiH+SnmQH2SbXJrVDPQ=
k8s.io/apimachinery v0.0.0-20230310204503-273f86d1012f h1:SMeRbv27Q4QvyAGw6IkqXzluMMJnL3gtBpk1W3fCao0=
k8s.io/apimachinery v0.0.0-20230310204503-273f86d1012f/go.mod h1:RWA+8iKvi6iwtPZ0MMwtZSlZRiH+SnmQH2SbXJrVDPQ=
k8s.io/client-go v0.0.0-20230310170151-6df09021f998 h1:gxGnQVRtt2NmwPYoPu+6xp+Y1lB3srWAA/kkXTQmQUQ=
k8s.io/client-go v0.0.0-20230310170151-6df09021f998/go.mod h1:seT1S8LUx48CIppmquME8d52oZQTiI2CX577lxB8cXA=
k8s.io/component-base v0.0.0-20230310085212-d69652187fff h1:xIjiK+aBPzY5Mqh/lFvmlfgvS1O35/hyhPw/LTmYyNA=

View File

@ -46,6 +46,10 @@ type LocationStreamer struct {
// TLSVerificationErrorCounter is an optional value that will Inc every time a TLS error is encountered. This can
// be wired a single prometheus counter instance to get counts overall.
TLSVerificationErrorCounter CounterMetric
// DeprecatedTLSVerificationErrorCounter is a temporary field used to rename
// the kube_apiserver_pod_logs_pods_logs_backend_tls_failure_total metric
// with a one release deprecation period in 1.27.0.
DeprecatedTLSVerificationErrorCounter CounterMetric
}
// a LocationStreamer must implement a rest.ResourceStreamer
@ -87,6 +91,9 @@ func (s *LocationStreamer) InputStream(ctx context.Context, apiVersion, acceptHe
// TODO prefer segregate TLS errors more reliably, but we do want to increment a count
if strings.Contains(err.Error(), "x509:") && s.TLSVerificationErrorCounter != nil {
s.TLSVerificationErrorCounter.Inc()
if s.DeprecatedTLSVerificationErrorCounter != nil {
s.DeprecatedTLSVerificationErrorCounter.Inc()
}
}
return nil, false, "", err
}