<p>As mentioned <a href="https://github.com/kubernetes/kube-state-metrics/issues/536#issue-358940186" rel="nofollow noreferrer">here</a>: &quot;Currently <code>namespace</code>, <code>pod</code> are default labels provided in the metrics.&quot;</p>
<hr />
<p><code>kubectl -n mynamespace get pods --show-labels</code> show the label values that are defined in deployment yaml for Kubernetes</p>
<hr />
<p>Goal is to use default label(<code>namespace</code> &amp; <code>pod</code> provided by kubernetes) values through Grafana dashboard's promQL, that prometheus monitor.</p>
<pre><code>sum(container_memory_working_set_bytes{namespace=&quot;mynamespace&quot;,pod=~&quot;unknown&quot;}) by (pod)
</code></pre>
<hr />
<p>How to view the values of default label <code>pod</code> using <code>kubectl</code>?</p>

overexchange
<p>According to the link that you shared, <code>{namespace}</code> and <code>{pod}</code> are default labels provided in the metrics, they are referring to the exposed metrics included in the <a href="https://github.com/kubernetes/kube-state-metrics" rel="nofollow noreferrer">kube-state-metrics (KSM) service.</a></p>
<p>kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
The exposed metrics are detailed <a href="https://github.com/kubernetes/kube-state-metrics/tree/master/docs" rel="nofollow noreferrer">in this document</a>.</p>
<p>In the following links, you can find the related metric for <a href="https://github.com/kubernetes/kube-state-metrics/blob/master/docs/pod-metrics.md" rel="nofollow noreferrer">Pods</a> and <a href="https://github.com/kubernetes/kube-state-metrics/blob/master/docs/namespace-metrics.md" rel="nofollow noreferrer">namespace</a>.</p>
<p>Speaking about the default labels for pods, you need to create a <a href="https://kubernetes.io/blog/2021/06/21/writing-a-controller-for-pod-labels/" rel="nofollow noreferrer">Pod label controller</a> or indicate the label in the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/pod#pod-templates" rel="nofollow noreferrer">Pod Template</a>.</p>
<p>If you don't explicitly specify labels for the controller, Kubernetes will use the pod template label as the default label for the controller itself. The pod selector will also default to pod template labels if unspecified.</p>
<p>If you want to know more about best practices for labels, please <a href="https://www.replex.io/blog/9-additional-best-practices-for-working-with-kubernetes-labels-and-label-selectors" rel="nofollow noreferrer">follow this link</a>.
If you want to know more about Labels and selector, <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/" rel="nofollow noreferrer">follow this link</a>.
More about <a href="https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates" rel="nofollow noreferrer">Pod Template here</a>.</p>
