Change:
The metric used to report acutal pod in the label , but now I see the podname prefix only. The full pod name in the label, so I can trace the metric to the failing pod. Check raw api and verify the actual pod name with uids. <details</detailsAzure AKS <details</detailsNo response No response No response_
/sig node
/triage accepted /priority important-soon /cc As discussed this is a change in functionaloty that wasn't highlighted in release notes. Need to decide on what do do with it. I understand it's a change of functionality. what is the side effect of this for you? Does the label without last part not informational enough?
I've been using the metric in my custom grafana dashboard that shows CPU, RAM, IO usage of pods with graph of increases in probes. If the apps are stable, the probe graph looks steadily. I can see if some irregularities in system metrics are influencing probes of respective pod. Also, if readiness probe is failing, the pod is removed from service, but is not restarted so I must have knowledge of pods with failing readiness probes. I attach the screenshot of my graph. ! So I'd welcome the possibility to pair the probes with exact pod and thank you for looking into it.
are we thinking that this resulted in an undesirable change? Spologies for being a bit late to reply, I'm returning from a brief paternity leave staycation.
This issue is labeled with but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release. You can: Confirm that this issue is still relevant with (org members only) Deprioritize it with or Close this issue with For more details on the triage process, see /remove-triage accepted
Well this is awkward... I still believe the actual behavior does not respect the intended idea...
This issue makes it hard to link probe metrics with right pods. The value of pod label in and are also inconsistent with how it is used in other kubelet metrics, see: vs Definitely a bug, regression since 1.25.
I can't get anyone to look at the fix/revert: you may have better luck
/milestone v1.28
discussion in
You've pushed it through, congrats!

Discussion:
import ( "context" <del> "fmt" </del> "math/rand" <del> "strings" </del> "time" v1 "k8s.io/api/core/v1"

"k8s.io/component-base/metrics" "k8s.io/klog/v2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" <del> "k8s.io/kubernetes/pkg/apis/apps" </del> kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/prober/results" )

w.initialValue = results.Unknown } <del> podName := getPodLabelName(w.pod) </del> basicMetricLabels := metrics.Labels{ "probe_type": w.probeType.String(), "container":  w.container.Name, <del> "pod":        podName, </del> <ins> "pod":        w.pod.Name, </ins> "namespace":  w.pod.Namespace, "pod_uid":    string(w.pod.UID), }

proberDurationLabels := metrics.Labels{ "probe_type": w.probeType.String(), "container":  w.container.Name, <del> "pod":        podName, </del> <ins> "pod":        w.pod.Name, </ins> "namespace":  w.pod.Namespace, }

} return ret } <del> func getPodLabelName(pod *v1.Pod) string { podName := pod.Name if pod.GenerateName != "" { podNameSlice := strings.Split(pod.Name, "-") podName = strings.Join(podNameSlice[:len(podNameSlice)-1], "-") if label, ok := pod.GetLabels()[apps.DefaultDeploymentUniqueLabelKey]; ok { podName = strings.ReplaceAll(podName, fmt.Sprintf("-%s", label), "") } } return podName } </del>

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/fake" <del> "k8s.io/kubernetes/pkg/apis/apps" </del> kubepod "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/prober/results" "k8s.io/kubernetes/pkg/kubelet/status"

expectContinue(t, w, w.doProbe(ctx), msg) expectResult(t, w, results.Success, msg) } <del> func TestGetPodLabelName(t *testing.T) { testCases := []struct { name   string pod    *v1.Pod result string }{ { name: "Static pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-controller-manager-k8s-master-21385161-0", }, }, result: "kube-controller-manager-k8s-master-21385161-0", }, { name: "Deployment pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name:         "coredns-845757d86-ccqpf", GenerateName: "coredns-845757d86-", Labels: map[string]string{ apps.DefaultDeploymentUniqueLabelKey: "845757d86", }, }, }, result: "coredns", }, { name: "ReplicaSet pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name:         "kube-proxy-2gmqn", GenerateName: "kube-proxy-", }, }, result: "kube-proxy", }, } for _, test := range testCases { ret := getPodLabelName(test.pod) if ret != test.result { t.Errorf("Expected %s, got %s", test.result, ret) } } } </del>