Skip to content

Commit

Permalink
Merge pull request #52 from rajaSahil/Add-ServiceMonitor-DeviceLocalPV
Browse files Browse the repository at this point in the history
Add ServiceMonitor for device-LocalPV and fixes localpv workload dashboard
  • Loading branch information
Vishnu Attur authored Jul 29, 2021
2 parents 94061a1 + 0a8feb3 commit 44a8857
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 15 deletions.
2 changes: 1 addition & 1 deletion deploy/charts/openebs-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions deploy/charts/openebs-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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}}",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
58 changes: 55 additions & 3 deletions deploy/charts/openebs-monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 44a8857

Please sign in to comment.