Bug 2018431 - [4.8] kube_persistentvolumeclaim_labels and kube_persistentvolume_labels are missing in OCP 4.8 monitoring stack
Summary: [4.8] kube_persistentvolumeclaim_labels and kube_persistentvolume_labels are ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.8.z
Assignee: Arunprasad Rajkumar
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On: 2015571
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-29 10:06 UTC by Arunprasad Rajkumar
Modified: 2022-10-18 03:34 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2015571
Environment:
Last Closed: 2021-11-16 21:22:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-monitoring-operator pull 1459 0 None open Bug 2018431: [4.8] add kube_persistentvolumeclaim_labels and kube_persistentvolume_labels 2021-11-08 05:24:46 UTC
Red Hat Product Errata RHBA-2021:4574 0 None None None 2021-11-16 21:23:07 UTC

Comment 1 Junqi Zhao 2021-11-08 07:53:55 UTC
tested with PR, could see PV/PVC labels
# oc -n openshift-monitoring get deployment kube-state-metrics -o yaml | grep metric-labels-allowlist
        - --metric-labels-allowlist=pods=[*],nodes=[*],namespaces=[*],persistentvolumes=[*],persistentvolumeclaims=[*]

# oc -n openshift-monitoring exec -c kube-state-metrics $(oc -n openshift-monitoring get po | grep kube-state-metrics | awk '{print $1}') -- kube-state-metrics --version
version.Version{GitCommit:"94716629", BuildDate:"2021-05-05T12:44:19Z", Release:"v2.0.0", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"}

# oc get pv pvc-de3ffcfc-daa0-4cdf-9c45-257844cd9979 -o jsonpath="{.metadata.labels"}
{"topology.kubernetes.io/region":"us-central1","topology.kubernetes.io/zone":"us-central1-a"}

search with kube_persistentvolume_labels, could see the PV labels
# token=`oc sa get-token prometheus-k8s -n openshift-monitoring`
# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/query?query=kube_persistentvolume_labels' | jq
...
{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "kube_persistentvolume_labels",
          "container": "kube-rbac-proxy-main",
          "endpoint": "https-main",
          "job": "kube-state-metrics",
          "label_topology_kubernetes_io_region": "us-central1",
          "label_topology_kubernetes_io_zone": "us-central1-a",
          "namespace": "openshift-monitoring",
          "persistentvolume": "pvc-de3ffcfc-daa0-4cdf-9c45-257844cd9979",
          "service": "kube-state-metrics"
        },
        "value": [
          1636357638.705,
          "1"
        ]
      },
...

pvc labels
# oc -n openshift-user-workload-monitoring get pvc thanosruler-thanos-ruler-user-workload-0 -o jsonpath="{.metadata.labels"}
{"app":"thanos-ruler","app.kubernetes.io/instance":"user-workload","app.kubernetes.io/managed-by":"prometheus-operator","app.kubernetes.io/name":"thanos-ruler","thanos-ruler":"user-workload"}

search with kube_persistentvolumeclaim_labels, could see the PVC labels
# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/query?query=kube_persistentvolumeclaim_labels' | jq
...
      {
        "metric": {
          "__name__": "kube_persistentvolumeclaim_labels",
          "container": "kube-rbac-proxy-main",
          "endpoint": "https-main",
          "job": "kube-state-metrics",
          "label_app": "thanos-ruler",
          "label_app_kubernetes_io_instance": "user-workload",
          "label_app_kubernetes_io_managed_by": "prometheus-operator",
          "label_app_kubernetes_io_name": "thanos-ruler",
          "label_thanos_ruler": "user-workload",
          "namespace": "openshift-user-workload-monitoring",
          "persistentvolumeclaim": "thanosruler-thanos-ruler-user-workload-0",
          "service": "kube-state-metrics"
        },
        "value": [
          1636357881.414,
          "1"
        ]
      },
...

Comment 6 errata-xmlrpc 2021-11-16 21:22:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.8.20 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4574


Note You need to log in before you can comment on or make changes to this bug.