From 592b95e834c9be5a98483a1af42c503e3c8c1656 Mon Sep 17 00:00:00 2001 From: Sahil Raja Date: Mon, 26 Jul 2021 01:08:09 +0530 Subject: [PATCH 1/2] Add device-localPV ServiceMonitor and update configuration for node-exporter Signed-off-by: Sahil Raja --- deploy/charts/openebs-monitoring/Chart.yaml | 2 +- deploy/charts/openebs-monitoring/README.md | 5 ++ deploy/charts/openebs-monitoring/values.yaml | 58 +++++++++++++++++++- 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/deploy/charts/openebs-monitoring/Chart.yaml b/deploy/charts/openebs-monitoring/Chart.yaml index 1d827cb..db2a50d 100644 --- a/deploy/charts/openebs-monitoring/Chart.yaml +++ b/deploy/charts/openebs-monitoring/Chart.yaml @@ -34,7 +34,7 @@ keywords: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.3.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deploy/charts/openebs-monitoring/README.md b/deploy/charts/openebs-monitoring/README.md index bf44f2d..7905dfe 100644 --- a/deploy/charts/openebs-monitoring/README.md +++ b/deploy/charts/openebs-monitoring/README.md @@ -141,6 +141,11 @@ helm install openebs-monitoring openebs-monitoring/monitoring --namespace openeb | `serviceMonitors.lvm-LocalPV.endpoints.path` | HTTP path to scrape for metrics from lvm localPV node | `"/metrics"` | | `serviceMonitors.lvm-LocalPV.selector` | Selector to select endpoints objects | `{matchLabels: {name: openebs-lvm-node}}` | | `serviceMonitors.lvm-LocalPV.namespaceSelector` | Selector to select which namespaces the endpoints objects are discovered from | `[any: true]` | +| `serviceMonitors.device-LocalPV.enabled` | Enables monitoring of device localPV | `true` | +| `serviceMonitors.device-LocalPV.endpoints.ports` | Name of the service port device localPV node endpoint refers to | `"metrics"` | +| `serviceMonitors.device-LocalPV.endpoints.path` | HTTP path to scrape for metrics from device localPV node | `"/metrics"` | +| `serviceMonitors.device-LocalPV.selector` | Selector to select endpoints objects | `{matchLabels: {name: openebs-device-node}}` | +| `serviceMonitors.device-LocalPV.namespaceSelector` | Selector to select which namespaces the endpoints objects are discovered from | `[any: true]` | | `podMonitors.cstor.enabled` | Enables monitoring of cStor pools | `true` | | `podMonitors.cstor.podMetricsEndpoints.targetPort` | Name or number of the cstor pool endpoint's target port | `9500` | | `podMonitors.cstor.podMetricsEndpoints.path` | HTTP path to scrape for metrics from cstor pool pod | `"/metrics"` | diff --git a/deploy/charts/openebs-monitoring/values.yaml b/deploy/charts/openebs-monitoring/values.yaml index 926603d..ab2e112 100644 --- a/deploy/charts/openebs-monitoring/values.yaml +++ b/deploy/charts/openebs-monitoring/values.yaml @@ -44,6 +44,7 @@ kube-prometheus-stack: extraArgs: - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+)($|/) - --collector.filesystem.ignored-fs-types=^(tmpfs|autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$ + - --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z]+|nvme\\d+n\\d+p)\\d+$ prometheus: service: @@ -179,9 +180,9 @@ node-problem-detector: ## Volume for storing logs extraVolumes: - - name: kmsg - hostPath: - path: /dev/kmsg + - name: kmsg + hostPath: + path: /dev/kmsg extraVolumeMounts: - name: kmsg @@ -435,6 +436,57 @@ serviceMonitors: namespaceSelector: any: true + device-LocalPV: + enabled: true + + ## Endpoints of the selected service to be monitored + endpoints: + ## Name of the endpoint's service port + ## Mutually exclusive with targetPort + # port: "" + port: metrics + + ## HTTP path to scrape for metrics + # path: /metrics + path: /metrics + + ## Label selector for services to which this ServiceMonitor applies + # selector: {} + # matchLabels: {} + + ## Example + + # selector: + # matchLabels: + # name: openebs-device-node + + selector: + matchLabels: + name: openebs-device-node + + ## Namespaces from which services are selected + # namespaceSelector: [] + ## Match any namespace + # any: true + + ## Example + + # namespaceSelector: + # any: true + + ## Explicit list of namespace names to select + # matchNames: [] + + ## Example + + # namespaceSelector: + # matchNames: + # - openebs + # - default + + namespaceSelector: + any: true + podMonitors: cstor: enabled: true From 0a8feb3784797e8e9bb7a763cbb26210513d3573 Mon Sep 17 00:00:00 2001 From: Sahil Raja Date: Mon, 26 Jul 2021 01:13:54 +0530 Subject: [PATCH 2/2] Fix localpv workload dashboard Signed-off-by: Sahil Raja Dashboard refresh fix Signed-off-by: Sahil Raja --- .../dashboards/LocalPV/localpv-workload.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/deploy/charts/openebs-monitoring/dashboards/LocalPV/localpv-workload.json b/deploy/charts/openebs-monitoring/dashboards/LocalPV/localpv-workload.json index b602d38..9e9d4a7 100644 --- a/deploy/charts/openebs-monitoring/dashboards/LocalPV/localpv-workload.json +++ b/deploy/charts/openebs-monitoring/dashboards/LocalPV/localpv-workload.json @@ -1842,7 +1842,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_size_bytes {fstype=~\"ext4|xfs\",mountpoint=~\"(.*$pvName.*/mount)\"}", + "expr": "node_filesystem_size_bytes {fstype=~\"ext4|xfs\",mountpoint=~\"(.+/($pvName/mount))\"}", "instant": true, "interval": "", "intervalFactor": 2, @@ -1934,7 +1934,7 @@ "targets": [ { "exemplar": true, - "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.*$pvName.*/mount)\",fstype=~\"ext4|xfs\"} * 100) / node_filesystem_size_bytes {mountpoint=~\"(.*$pvName.*/mount)\",fstype=~\"ext4|xfs\"})", + "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.+/($pvName/mount))\",fstype=~\"ext4|xfs\"} * 100) / node_filesystem_size_bytes {mountpoint=~\"(.+/($pvName/mount))\",fstype=~\"ext4|xfs\"})", "interval": "10s", "intervalFactor": 2, "legendFormat": "", @@ -2007,7 +2007,7 @@ "targets": [ { "exemplar": true, - "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.*$pvName.*/mount)\"} * 100) / node_filesystem_size_bytes {mountpoint=~\"(.*$pvName.*/mount)\"})", + "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.+/($pvName/mount))\"} * 100) / node_filesystem_size_bytes {mountpoint=~\"(.+/($pvName/mount))\"})", "interval": "10s", "intervalFactor": 2, "legendFormat": "Pvc: $pvcName, Mount Point: {{mountpoint}}", @@ -2110,7 +2110,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_avail_bytes{mountpoint=~\"(.*$pvName.*/mount)\"}", + "expr": "node_filesystem_avail_bytes{mountpoint=~\"(.+/($pvName/mount))\"}", "format": "time_series", "hide": false, "interval": "", @@ -2216,7 +2216,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_files_free{mountpoint=~\"(.*$pvName.*/mount)\"}", + "expr": "node_filesystem_files_free{mountpoint=~\"(.+/($pvName/mount))\"}", "format": "time_series", "hide": false, "interval": "", @@ -2321,7 +2321,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_files{mountpoint=~\"(.*$pvName.*/mount)\"}", + "expr": "node_filesystem_files{mountpoint=~\"(.+/($pvName/mount))\"}", "format": "time_series", "hide": false, "interval": "", @@ -2431,7 +2431,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_readonly{mountpoint=~\"(.*$pvName.*/mount)\"}", + "expr": "node_filesystem_readonly{mountpoint=~\"(.+/($pvName/mount))\"}", "format": "time_series", "interval": "", "intervalFactor": 2, @@ -2541,7 +2541,7 @@ "targets": [ { "exemplar": true, - "expr": "node_filesystem_device_error{mountpoint=~\"(.*$pvName.*/mount)\"} ", + "expr": "node_filesystem_device_error{mountpoint=~\"(.+/($pvName/mount))\"} ", "format": "time_series", "hide": false, "interval": "", @@ -2676,7 +2676,7 @@ "targets": [ { "exemplar": true, - "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.*$pvName.*/mount)\"} * 100) / node_filesystem_size_bytes{mountpoint=~\"(.*$pvName.*/mount)\"})", + "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=~\"(.+/($pvName/mount))\"} * 100) / node_filesystem_size_bytes{mountpoint=~\"(.+/($pvName/mount))\"})", "format": "time_series", "interval": "", "intervalFactor": 2, @@ -4048,7 +4048,7 @@ "name": "workload", "options": [], "query": "label_values(namespace_workload_pod:kube_pod_owner:relabel{cluster=\"$cluster\", namespace=\"$namespace\"}, workload)", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1, @@ -4072,7 +4072,7 @@ "name": "type", "options": [], "query": "label_values(namespace_workload_pod:kube_pod_owner:relabel{workload=\"$workload\"}, workload_type)", - "refresh": 1, + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1,