From 5d7a6e0abd51f348022796831ecc92f0de2850c6 Mon Sep 17 00:00:00 2001 From: hardikl Date: Tue, 10 Dec 2024 17:22:00 +0530 Subject: [PATCH 01/19] feat: adding the bucket and policy rest template --- conf/rest/9.12.0/snapshotpolicy.yaml | 5 +++-- conf/rest/9.6.0/clusterschedule.yaml | 19 +++++++++++++++++++ conf/rest/9.6.0/snapmirrorpolicy.yaml | 23 +++++++++++++++++++++++ conf/rest/default.yaml | 2 ++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 conf/rest/9.6.0/clusterschedule.yaml create mode 100644 conf/rest/9.6.0/snapmirrorpolicy.yaml diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index 939757165..1374b1c1e 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -3,9 +3,10 @@ query: api/private/cli/snapshot/policy object: snapshot_policy counters: - - ^^policy => snapshot_policy + - ^^policy => snapshot_policy - ^^vserver => svm - - ^comment => comment + - ^comment => comment + - ^schedules => schedules - total_schedules => total_schedules export_options: diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml new file mode 100644 index 000000000..a0e984148 --- /dev/null +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -0,0 +1,19 @@ +name: ClusterSchedule +query: api/cluster/schedules +object: cluster_schedule + +counters: + - ^^uuid => uuid + - ^crone => crone + - ^interval => interval + - ^svm.name => svm + - ^type + +export_options: + instance_keys: + - svm + instance_labels: + - crone + - interval + - type + diff --git a/conf/rest/9.6.0/snapmirrorpolicy.yaml b/conf/rest/9.6.0/snapmirrorpolicy.yaml new file mode 100644 index 000000000..48f8b174f --- /dev/null +++ b/conf/rest/9.6.0/snapmirrorpolicy.yaml @@ -0,0 +1,23 @@ +name: SnapMirrorPolicy +query: api/private/cli/snapmirror +object: snapmirror_policy + +counters: + - ^^uuid => uuid + - ^name => policy_name + - ^scope + - ^svm.name => svm + - ^transfer_schedule.name => schedule_name + - ^type + + +export_options: + instance_keys: + - policy_name + - svm + instance_labels: + - policy_name + - schedule_name + - scope + - type + diff --git a/conf/rest/default.yaml b/conf/rest/default.yaml index 2fa210fd6..054f0f7f0 100644 --- a/conf/rest/default.yaml +++ b/conf/rest/default.yaml @@ -16,6 +16,7 @@ objects: # CIFSShare: cifs_share.yaml CloudTarget: cloud_target.yaml ClusterPeer: clusterpeer.yaml + ClusterSchedule: clusterschedule.yaml ClusterSoftware: clustersoftware.yaml Disk: disk.yaml EmsDestination: ems_destination.yaml @@ -53,6 +54,7 @@ objects: Sensor: sensor.yaml Shelf: shelf.yaml SnapMirror: snapmirror.yaml + SnapMirrorPolicy: snapmirrorpolicy.yaml SnapshotPolicy: snapshotpolicy.yaml Status: status.yaml Subsystem: subsystem.yaml From 880f796c8f836c53a1cbf253df760a3f405e5644 Mon Sep 17 00:00:00 2001 From: hardikl Date: Tue, 10 Dec 2024 19:55:50 +0530 Subject: [PATCH 02/19] feat: update templates --- conf/rest/9.12.0/snapshotpolicy.yaml | 1 + conf/rest/9.6.0/clusterschedule.yaml | 9 +++++---- conf/rest/9.6.0/snapmirrorpolicy.yaml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index 1374b1c1e..f6d1d70f8 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -12,5 +12,6 @@ counters: export_options: instance_keys: - comment + - schedules - snapshot_policy - svm \ No newline at end of file diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml index a0e984148..95089e6f3 100644 --- a/conf/rest/9.6.0/clusterschedule.yaml +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -4,16 +4,17 @@ object: cluster_schedule counters: - ^^uuid => uuid + - ^name => name - ^crone => crone - - ^interval => interval - ^svm.name => svm - ^type + - interval(duration) => interval export_options: instance_keys: - - svm + - name + - type instance_labels: - crone - - interval - - type + - svm diff --git a/conf/rest/9.6.0/snapmirrorpolicy.yaml b/conf/rest/9.6.0/snapmirrorpolicy.yaml index 48f8b174f..e6a91e387 100644 --- a/conf/rest/9.6.0/snapmirrorpolicy.yaml +++ b/conf/rest/9.6.0/snapmirrorpolicy.yaml @@ -1,5 +1,5 @@ name: SnapMirrorPolicy -query: api/private/cli/snapmirror +query: api/snapmirror/policies object: snapmirror_policy counters: From 3f7104e07e90eba99505ae6cfb188cb2b7dbcb1e Mon Sep 17 00:00:00 2001 From: hardikl Date: Tue, 10 Dec 2024 19:56:19 +0530 Subject: [PATCH 03/19] feat: missed file --- conf/rest/9.6.0/clusterschedule.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml index 95089e6f3..872ffefac 100644 --- a/conf/rest/9.6.0/clusterschedule.yaml +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -4,8 +4,8 @@ object: cluster_schedule counters: - ^^uuid => uuid - - ^name => name - ^crone => crone + - ^name => name - ^svm.name => svm - ^type - interval(duration) => interval From 3dd554d4ca0c565766d92e251d27a5084ace107e Mon Sep 17 00:00:00 2001 From: hardikl Date: Tue, 10 Dec 2024 21:21:12 +0530 Subject: [PATCH 04/19] feat: update permission for new api --- conf/rest/9.6.0/clusterschedule.yaml | 4 ++-- docs/prepare-cdot-clusters.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml index 872ffefac..ce36320d1 100644 --- a/conf/rest/9.6.0/clusterschedule.yaml +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -4,7 +4,7 @@ object: cluster_schedule counters: - ^^uuid => uuid - - ^crone => crone + - ^cron => cron - ^name => name - ^svm.name => svm - ^type @@ -15,6 +15,6 @@ export_options: - name - type instance_labels: - - crone + - cron - svm diff --git a/docs/prepare-cdot-clusters.md b/docs/prepare-cdot-clusters.md index 98e0590ee..df84efb83 100644 --- a/docs/prepare-cdot-clusters.md +++ b/docs/prepare-cdot-clusters.md @@ -197,6 +197,7 @@ security login rest-role create -role harvest2-rest-role -access readonly -api / security login rest-role create -role harvest-rest-role -access readonly -api /api/security/login/messages security login rest-role create -role harvest-rest-role -access readonly -api /api/security/ssh security login rest-role create -role harvest-rest-role -access readonly -api /api/snapmirror/relationships + security login rest-role create -role harvest-rest-role -access readonly -api /api/snapmirror/policies security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/aggregates security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/disks security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/flexcache/flexcaches From 7e2ebf3df2e1cac787cba97186e56e12dc83db55 Mon Sep 17 00:00:00 2001 From: hardikl Date: Mon, 16 Dec 2024 19:35:49 +0530 Subject: [PATCH 05/19] feat: update dashboard with local policy settings --- .../plugins/snapshotpolicy/snapshotpolicy.go | 40 ++ cmd/collectors/rest/rest.go | 3 + conf/rest/9.12.0/snapshotpolicy.yaml | 23 +- conf/rest/9.6.0/snapmirrorpolicy.yaml | 2 + .../cmode/data_protection_snapshot.json | 532 ++++++++++++++++++ 5 files changed, 594 insertions(+), 6 deletions(-) create mode 100644 cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go diff --git a/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go new file mode 100644 index 000000000..4c5fc6781 --- /dev/null +++ b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go @@ -0,0 +1,40 @@ +/* + * Copyright NetApp Inc, 2024 All rights reserved + */ + +package snapshotpolicy + +import ( + "github.com/netapp/harvest/v2/cmd/poller/plugin" + "github.com/netapp/harvest/v2/pkg/matrix" + "github.com/netapp/harvest/v2/pkg/util" + "strconv" + "strings" +) + +type SnapshotPolicy struct { + *plugin.AbstractPlugin +} + +func New(p *plugin.AbstractPlugin) plugin.Plugin { + return &SnapshotPolicy{AbstractPlugin: p} +} + +func (m *SnapshotPolicy) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, *util.Metadata, error) { + // Purge and reset data + data := dataMap[m.Object] + + for _, instance := range data.GetInstances() { + copies := strings.Split(instance.GetLabel("copies"), ",") + if len(copies) > 1 { + var copiesValue int + for _, c := range copies { + val, _ := strconv.Atoi(c) + copiesValue += val + } + instance.SetLabel("copies", strconv.Itoa(copiesValue)) + } + } + + return nil, nil, nil +} diff --git a/cmd/collectors/rest/rest.go b/cmd/collectors/rest/rest.go index 67b0c2fb6..886a17c06 100644 --- a/cmd/collectors/rest/rest.go +++ b/cmd/collectors/rest/rest.go @@ -19,6 +19,7 @@ import ( "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/securityaccount" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/shelf" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/snapmirror" + "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/snapshotpolicy" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/svm" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/systemnode" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/volume" @@ -498,6 +499,8 @@ func (r *Rest) LoadPlugin(kind string, abc *plugin.AbstractPlugin) plugin.Plugin return collectors.NewSensor(abc) case "Shelf": return shelf.New(abc) + case "SnapshotPolicy": + return snapshotpolicy.New(abc) case "SecurityAccount": return securityaccount.New(abc) case "QosPolicyFixed": diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index f6d1d70f8..be0963694 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -1,17 +1,28 @@ name: SnapshotPolicy -query: api/private/cli/snapshot/policy +query: api/storage/snapshot-policies object: snapshot_policy counters: - - ^^policy => snapshot_policy - - ^^vserver => svm + - ^^uuid => uuid - ^comment => comment + - ^copies.#.count => copies + - ^enabled => status + - ^name => snapshot_policy - ^schedules => schedules - - total_schedules => total_schedules + - ^scope => scope + - ^svm.name => svm + +plugins: + - SnapshotPolicy export_options: instance_keys: + - snapshot_policy + instance_labels: - comment + - copies - schedules - - snapshot_policy - - svm \ No newline at end of file + - scope + - status + - svm + diff --git a/conf/rest/9.6.0/snapmirrorpolicy.yaml b/conf/rest/9.6.0/snapmirrorpolicy.yaml index e6a91e387..1e90370bc 100644 --- a/conf/rest/9.6.0/snapmirrorpolicy.yaml +++ b/conf/rest/9.6.0/snapmirrorpolicy.yaml @@ -4,6 +4,7 @@ object: snapmirror_policy counters: - ^^uuid => uuid + - ^comment => comment - ^name => policy_name - ^scope - ^svm.name => svm @@ -16,6 +17,7 @@ export_options: - policy_name - svm instance_labels: + - comment - policy_name - schedule_name - scope diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection_snapshot.json index b05b5c6e3..9679574c5 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection_snapshot.json @@ -1562,6 +1562,538 @@ ], "title": "Snapshot Copies Analysis", "type": "row" + }, + { + "collapsed": true, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 2 + }, + "id": 23, + "panels": [ + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel displays volumes detail with snapshot count.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "datacenter" + }, + "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Policy Type" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "async": { + "index": 0, + "text": "Asynchronous" + }, + "continuous": { + "index": 2, + "text": "Continuous" + }, + "sync": { + "index": 1, + "text": "Synchronous" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.width", + "value": 152 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Transfer Schedule" + }, + "properties": [ + { + "id": "noValue", + "value": "-" + }, + { + "id": "custom.width", + "value": 151 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Description" + }, + "properties": [ + { + "id": "custom.width", + "value": 306 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 260 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Scope" + }, + "properties": [ + { + "id": "custom.width", + "value": 124 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Datacenter" + }, + "properties": [ + { + "id": "custom.width", + "value": 171 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cluster" + }, + "properties": [ + { + "id": "custom.width", + "value": 217 + } + ] + } + ] + }, + "gridPos": { + "h": 15, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 100, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.4.11", + "targets": [ + { + "exemplar": false, + "expr": "snapmirror_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Protection policies", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "cluster", + "datacenter", + "policy_name", + "scope", + "type", + "schedule_name", + "comment" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "cluster": 1, + "comment": 3, + "datacenter": 0, + "policy_name": 2, + "schedule_name": 6, + "scope": 5, + "type": 4 + }, + "renameByName": { + "Value": "Snapshot Copies", + "cluster": "", + "comment": "Description", + "policy_name": "Name", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "type": "Policy Type", + "volume": "" + } + } + } + ], + "type": "table" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel displays volumes detail with snapshot count.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "datacenter" + }, + "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Policy Type" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "async": { + "index": 0, + "text": "Asynchronous" + }, + "continuous": { + "index": 2, + "text": "Continuous" + }, + "sync": { + "index": 1, + "text": "Synchronous" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.width", + "value": 152 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Transfer Schedule" + }, + "properties": [ + { + "id": "noValue", + "value": "-" + }, + { + "id": "custom.width", + "value": 151 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Description" + }, + "properties": [ + { + "id": "custom.width", + "value": 306 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 260 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Scope" + }, + "properties": [ + { + "id": "custom.width", + "value": 124 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Datacenter" + }, + "properties": [ + { + "id": "custom.width", + "value": 171 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cluster" + }, + "properties": [ + { + "id": "custom.width", + "value": 217 + } + ] + } + ] + }, + "gridPos": { + "h": 15, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 101, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.4.11", + "targets": [ + { + "exemplar": false, + "expr": "snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Snapshot policies", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "cluster", + "datacenter", + "policy_name", + "scope", + "type", + "schedule_name", + "comment" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "cluster": 1, + "comment": 3, + "datacenter": 0, + "policy_name": 2, + "schedule_name": 6, + "scope": 5, + "type": 4 + }, + "renameByName": { + "Value": "Snapshot Copies", + "cluster": "", + "comment": "Description", + "policy_name": "Name", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "type": "Policy Type", + "volume": "" + } + } + } + ], + "type": "table" + } + ], + "title": "Local policy settings", + "type": "row" } ], "refresh": "", From 89fedade5412dd6011941841529f1f561eda467f Mon Sep 17 00:00:00 2001 From: hardikl Date: Tue, 17 Dec 2024 20:22:54 +0530 Subject: [PATCH 06/19] feat: add policy tables in data protection dashboard --- cmd/collectors/commonutils.go | 82 +++++ cmd/collectors/commonutils_test.go | 62 ++++ .../clusterschedule/clusterschedule.go | 60 ++++ cmd/collectors/rest/rest.go | 7 +- cmd/collectors/rest/templating.go | 84 ----- cmd/collectors/rest/templating_test.go | 67 ---- conf/rest/9.6.0/clusterschedule.yaml | 8 +- .../cmode/data_protection_snapshot.json | 336 ++++++++++++++++-- 8 files changed, 516 insertions(+), 190 deletions(-) create mode 100644 cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go delete mode 100644 cmd/collectors/rest/templating_test.go diff --git a/cmd/collectors/commonutils.go b/cmd/collectors/commonutils.go index a9330f30b..59600aee9 100644 --- a/cmd/collectors/commonutils.go +++ b/cmd/collectors/commonutils.go @@ -11,6 +11,7 @@ import ( "github.com/netapp/harvest/v2/third_party/tidwall/gjson" "log/slog" "os" + "regexp" "sort" "strconv" "strings" @@ -543,3 +544,84 @@ func PopulateIfgroupMetrics(portIfgroupMap map[string]string, portDataMap map[st } return nil } + +func HandleDuration(value string) float64 { + // Example: duration: PT8H35M42S + timeDurationRegex := `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:.\d+)?)S)?$` + + regexTimeDuration := regexp.MustCompile(timeDurationRegex) + if match := regexTimeDuration.MatchString(value); match { + // example: PT8H35M42S ==> 30942 + matches := regexTimeDuration.FindStringSubmatch(value) + if matches == nil { + return 0 + } + + seconds := 0.0 + + // years + // months + + // days + if matches[3] != "" { + f, err := strconv.ParseFloat(matches[3], 64) + if err != nil { + fmt.Printf("%v", err) + return 0 + } + seconds += f * 24 * 60 * 60 + } + + // hours + if matches[4] != "" { + f, err := strconv.ParseFloat(matches[4], 64) + if err != nil { + fmt.Printf("%v", err) + return 0 + } + seconds += f * 60 * 60 + } + + // minutes + if matches[5] != "" { + f, err := strconv.ParseFloat(matches[5], 64) + if err != nil { + fmt.Printf("%v", err) + return 0 + } + seconds += f * 60 + } + + // seconds & milliseconds + if matches[6] != "" { + f, err := strconv.ParseFloat(matches[6], 64) + if err != nil { + fmt.Printf("%v", err) + return 0 + } + seconds += f + } + return seconds + } + + return 0 +} + +// Example: timestamp: 2020-12-02T18:36:19-08:00 +var regexTimeStamp = regexp.MustCompile( + `[+-]?\d{4}(-[01]\d(-[0-3]\d(T[0-2]\d:[0-5]\d:?([0-5]\d(\.\d+)?)?[+-][0-2]\d:[0-5]\d?)?)?)?`) + +func HandleTimestamp(value string) float64 { + var timestamp time.Time + var err error + + if match := regexTimeStamp.MatchString(value); match { + // example: 2020-12-02T18:36:19-08:00 ==> 1606962979 + if timestamp, err = time.Parse(time.RFC3339, value); err != nil { + fmt.Printf("%v", err) + return 0 + } + return float64(timestamp.Unix()) + } + return 0 +} diff --git a/cmd/collectors/commonutils_test.go b/cmd/collectors/commonutils_test.go index 3319dd98f..b81903520 100644 --- a/cmd/collectors/commonutils_test.go +++ b/cmd/collectors/commonutils_test.go @@ -411,3 +411,65 @@ func Test_SplitVscanName(t *testing.T) { }) } } + +func Test_HandleDuration(t *testing.T) { + + type test struct { + timeFieldValue string + want float64 + } + + var tests = []test{ + { + timeFieldValue: "PT54S", + want: 54, + }, + { + timeFieldValue: "PT48M", + want: 2880, + }, + { + timeFieldValue: "P428DT22H45M19S", + want: 37061119, + }, + { + timeFieldValue: "PT8H35M42S", + want: 30942, + }, + } + + for _, tt := range tests { + t.Run(tt.timeFieldValue, func(t *testing.T) { + if got := HandleDuration(tt.timeFieldValue); got != tt.want { + t.Errorf("actual value = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_HandleTimestamp(t *testing.T) { + + type test struct { + timeFieldValue string + want float64 + } + + var tests = []test{ + { + timeFieldValue: "2020-12-02T18:36:19-08:00", + want: 1606962979, + }, + { + timeFieldValue: "2022-01-31T04:05:02-05:00", + want: 1643619902, + }, + } + + for _, tt := range tests { + t.Run(tt.timeFieldValue, func(t *testing.T) { + if got := HandleTimestamp(tt.timeFieldValue); got != tt.want { + t.Errorf("actual value = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go new file mode 100644 index 000000000..6447ddd55 --- /dev/null +++ b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go @@ -0,0 +1,60 @@ +package clusterschedule + +import ( + "github.com/netapp/harvest/v2/cmd/collectors" + "github.com/netapp/harvest/v2/cmd/poller/plugin" + "github.com/netapp/harvest/v2/pkg/matrix" + "github.com/netapp/harvest/v2/pkg/util" + "github.com/netapp/harvest/v2/third_party/tidwall/gjson" + "strconv" + "strings" +) + +type ClusterScheule struct { + *plugin.AbstractPlugin +} + +func New(p *plugin.AbstractPlugin) plugin.Plugin { + return &ClusterScheule{AbstractPlugin: p} +} + +func (c *ClusterScheule) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, *util.Metadata, error) { + for _, instance := range dataMap[c.Object].GetInstances() { + intervalVal := collectors.HandleDuration(instance.GetLabel("interval")) + instance.SetLabel("interval", strconv.FormatFloat(intervalVal, 'f', -1, 64)) + + cron := instance.GetLabel("cron") + updateDetailsJSON := gjson.Result{Type: gjson.JSON, Raw: cron} + var cronVal, minStr, hourStr, weekDayStr string + if minutes := updateDetailsJSON.Get("minutes"); minutes.Exists() { + for _, m := range minutes.Array() { + minStr = minStr + m.String() + ", " + } + minStr = strings.TrimSuffix(minStr, ", ") + } + if hours := updateDetailsJSON.Get("hours"); hours.Exists() { + for _, h := range hours.Array() { + hourStr = hourStr + h.String() + ", " + } + hourStr = strings.TrimSuffix(hourStr, ", ") + } + if weekdays := updateDetailsJSON.Get("weekdays"); weekdays.Exists() { + for _, w := range weekdays.Array() { + weekDayStr = weekDayStr + w.String() + ", " + } + weekDayStr = strings.TrimSuffix(weekDayStr, ", ") + } + + if minStr != "" { + cronVal = cronVal + "minutes: " + "[" + minStr + "] " + } + if hourStr != "" { + cronVal = cronVal + "hours: " + "[" + hourStr + "] " + } + if weekDayStr != "" { + cronVal = cronVal + "weekdays: " + "[" + weekDayStr + "]" + } + instance.SetLabel("cron", cronVal) + } + return nil, nil, nil +} diff --git a/cmd/collectors/rest/rest.go b/cmd/collectors/rest/rest.go index 886a17c06..2df5b5994 100644 --- a/cmd/collectors/rest/rest.go +++ b/cmd/collectors/rest/rest.go @@ -7,6 +7,7 @@ import ( "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/aggregate" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/certificate" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/cluster" + "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/clusterschedule" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/clustersoftware" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/disk" "github.com/netapp/harvest/v2/cmd/collectors/rest/plugins/health" @@ -475,6 +476,8 @@ func (r *Rest) LoadPlugin(kind string, abc *plugin.AbstractPlugin) plugin.Plugin return aggregate.New(abc) case "Cluster": return cluster.New(abc) + case "ClusterSchedule": + return clusterschedule.New(abc) case "ClusterSoftware": return clustersoftware.New(abc) case "Disk": @@ -633,9 +636,9 @@ func (r *Rest) HandleResults(mat *matrix.Matrix, result []gjson.Result, prop *pr var floatValue float64 switch metric.MetricType { case "duration": - floatValue = HandleDuration(f.ClonedString()) + floatValue = collectors.HandleDuration(f.ClonedString()) case "timestamp": - floatValue = HandleTimestamp(f.ClonedString()) + floatValue = collectors.HandleTimestamp(f.ClonedString()) case "": floatValue = f.Float() default: diff --git a/cmd/collectors/rest/templating.go b/cmd/collectors/rest/templating.go index 0e29bc9c8..ca803385e 100644 --- a/cmd/collectors/rest/templating.go +++ b/cmd/collectors/rest/templating.go @@ -1,18 +1,15 @@ package rest import ( - "fmt" "github.com/netapp/harvest/v2/cmd/collectors" "github.com/netapp/harvest/v2/pkg/errs" "github.com/netapp/harvest/v2/pkg/tree/node" "github.com/netapp/harvest/v2/pkg/util" "log/slog" "maps" - "regexp" "slices" "strconv" "strings" - "time" ) func (r *Rest) LoadTemplate() (string, error) { @@ -94,87 +91,6 @@ func (r *Rest) InitCache() error { return nil } -func HandleDuration(value string) float64 { - // Example: duration: PT8H35M42S - timeDurationRegex := `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:.\d+)?)S)?$` - - regexTimeDuration := regexp.MustCompile(timeDurationRegex) - if match := regexTimeDuration.MatchString(value); match { - // example: PT8H35M42S ==> 30942 - matches := regexTimeDuration.FindStringSubmatch(value) - if matches == nil { - return 0 - } - - seconds := 0.0 - - // years - // months - - // days - if matches[3] != "" { - f, err := strconv.ParseFloat(matches[3], 64) - if err != nil { - fmt.Printf("%v", err) - return 0 - } - seconds += f * 24 * 60 * 60 - } - - // hours - if matches[4] != "" { - f, err := strconv.ParseFloat(matches[4], 64) - if err != nil { - fmt.Printf("%v", err) - return 0 - } - seconds += f * 60 * 60 - } - - // minutes - if matches[5] != "" { - f, err := strconv.ParseFloat(matches[5], 64) - if err != nil { - fmt.Printf("%v", err) - return 0 - } - seconds += f * 60 - } - - // seconds & milliseconds - if matches[6] != "" { - f, err := strconv.ParseFloat(matches[6], 64) - if err != nil { - fmt.Printf("%v", err) - return 0 - } - seconds += f - } - return seconds - } - - return 0 -} - -// Example: timestamp: 2020-12-02T18:36:19-08:00 -var regexTimeStamp = regexp.MustCompile( - `[+-]?\d{4}(-[01]\d(-[0-3]\d(T[0-2]\d:[0-5]\d:?([0-5]\d(\.\d+)?)?[+-][0-2]\d:[0-5]\d?)?)?)?`) - -func HandleTimestamp(value string) float64 { - var timestamp time.Time - var err error - - if match := regexTimeStamp.MatchString(value); match { - // example: 2020-12-02T18:36:19-08:00 ==> 1606962979 - if timestamp, err = time.Parse(time.RFC3339, value); err != nil { - fmt.Printf("%v", err) - return 0 - } - return float64(timestamp.Unix()) - } - return 0 -} - func (r *Rest) ParseRestCounters(counter *node.Node, prop *prop) { var ( display, name, kind, metricType string diff --git a/cmd/collectors/rest/templating_test.go b/cmd/collectors/rest/templating_test.go deleted file mode 100644 index 7fd78df45..000000000 --- a/cmd/collectors/rest/templating_test.go +++ /dev/null @@ -1,67 +0,0 @@ -package rest - -import ( - "testing" -) - -func Test_HandleDuration(t *testing.T) { - - type test struct { - timeFieldValue string - want float64 - } - - var tests = []test{ - { - timeFieldValue: "PT54S", - want: 54, - }, - { - timeFieldValue: "PT48M", - want: 2880, - }, - { - timeFieldValue: "P428DT22H45M19S", - want: 37061119, - }, - { - timeFieldValue: "PT8H35M42S", - want: 30942, - }, - } - - for _, tt := range tests { - t.Run(tt.timeFieldValue, func(t *testing.T) { - if got := HandleDuration(tt.timeFieldValue); got != tt.want { - t.Errorf("actual value = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_HandleTimestamp(t *testing.T) { - - type test struct { - timeFieldValue string - want float64 - } - - var tests = []test{ - { - timeFieldValue: "2020-12-02T18:36:19-08:00", - want: 1606962979, - }, - { - timeFieldValue: "2022-01-31T04:05:02-05:00", - want: 1643619902, - }, - } - - for _, tt := range tests { - t.Run(tt.timeFieldValue, func(t *testing.T) { - if got := HandleTimestamp(tt.timeFieldValue); got != tt.want { - t.Errorf("actual value = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml index ce36320d1..29699d460 100644 --- a/conf/rest/9.6.0/clusterschedule.yaml +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -5,10 +5,14 @@ object: cluster_schedule counters: - ^^uuid => uuid - ^cron => cron + - ^interval(duration) => interval - ^name => name + - ^scope => scope - ^svm.name => svm - ^type - - interval(duration) => interval + +plugins: + - ClusterSchedule export_options: instance_keys: @@ -16,5 +20,7 @@ export_options: - type instance_labels: - cron + - interval + - scope - svm diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection_snapshot.json index 9679574c5..510ce8f30 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection_snapshot.json @@ -1674,7 +1674,7 @@ }, { "id": "custom.width", - "value": 152 + "value": 179 } ] }, @@ -1702,7 +1702,7 @@ "properties": [ { "id": "custom.width", - "value": 306 + "value": 529 } ] }, @@ -1726,7 +1726,21 @@ "properties": [ { "id": "custom.width", - "value": 124 + "value": 166 + }, + { + "id": "mappings", + "value": [ + { + "options": { + "cluster": { + "index": 0, + "text": "Cluster" + } + }, + "type": "value" + } + ] } ] }, @@ -1906,50 +1920,301 @@ { "matcher": { "id": "byName", - "options": "Policy Type" + "options": "Description" + }, + "properties": [ + { + "id": "custom.width", + "value": 456 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Scope" }, "properties": [ + { + "id": "custom.width", + "value": 124 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Datacenter" + }, + "properties": [ + { + "id": "custom.width", + "value": 171 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cluster" + }, + "properties": [ + { + "id": "custom.width", + "value": 217 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Scope" + }, + "properties": [ + { + "id": "noValue", + "value": "Cluster" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "copies" + }, + "properties": [ + { + "id": "noValue", + "value": "0" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Policy Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 215 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "custom.displayMode", + "value": "color-background-solid" + }, { "id": "mappings", "value": [ { "options": { - "async": { - "index": 0, - "text": "Asynchronous" - }, - "continuous": { - "index": 2, - "text": "Continuous" - }, - "sync": { + "false": { + "color": "semi-dark-red", "index": 1, - "text": "Synchronous" + "text": "Disabled" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Enabled" } }, "type": "value" } ] + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 101, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.4.11", + "targets": [ + { + "exemplar": false, + "expr": "snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Snapshot policies", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "cluster", + "comment", + "datacenter", + "snapshot_policy", + "status", + "copies", + "svm" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "cluster": 1, + "comment": 3, + "copies": 6, + "datacenter": 0, + "snapshot_policy": 2, + "status": 4, + "svm": 5 + }, + "renameByName": { + "Value": "Snapshot Copies", + "cluster": "", + "comment": "Description", + "policy_name": "Name", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "snapshot_policy": "Policy Name", + "status": "Status", + "svm": "Scope", + "type": "Policy Type", + "volume": "" + } + } + } + ], + "type": "table" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel displays volumes detail with snapshot count.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "datacenter" + }, + "properties": [ + { + "id": "displayName", + "value": "Datacenter" }, { - "id": "custom.width", - "value": 152 + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] } ] }, { "matcher": { "id": "byName", - "options": "Transfer Schedule" + "options": "Type" }, "properties": [ { - "id": "noValue", - "value": "-" + "id": "mappings", + "value": [ + { + "options": { + "cron": { + "index": 0, + "text": "Time-based" + }, + "interval": { + "index": 1, + "text": "Interval-based" + } + }, + "type": "value" + } + ] }, { "id": "custom.width", - "value": 151 + "value": 152 } ] }, @@ -1973,7 +2238,7 @@ "properties": [ { "id": "custom.width", - "value": 260 + "value": 360 } ] }, @@ -2009,7 +2274,7 @@ "properties": [ { "id": "custom.width", - "value": 217 + "value": 233 } ] } @@ -2019,9 +2284,9 @@ "h": 15, "w": 24, "x": 0, - "y": 22 + "y": 30 }, - "id": 101, + "id": 102, "options": { "footer": { "fields": "", @@ -2037,7 +2302,7 @@ "targets": [ { "exemplar": false, - "expr": "snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "expr": "cluster_schedule_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", "format": "table", "instant": true, "interval": "", @@ -2045,7 +2310,7 @@ "refId": "A" } ], - "title": "Snapshot policies", + "title": "Schedules", "transformations": [ { "id": "filterFieldsByName", @@ -2053,12 +2318,11 @@ "include": { "names": [ "cluster", + "cron", "datacenter", - "policy_name", - "scope", + "name", "type", - "schedule_name", - "comment" + "scope" ] } } @@ -2067,23 +2331,23 @@ "id": "organize", "options": { "excludeByName": {}, + "includeByName": {}, "indexByName": { "cluster": 1, - "comment": 3, "datacenter": 0, - "policy_name": 2, - "schedule_name": 6, - "scope": 5, - "type": 4 + "name": 2, + "type": 3 }, "renameByName": { "Value": "Snapshot Copies", "cluster": "", "comment": "Description", + "cron": "Schedule", + "name": "Name", "policy_name": "Name", "schedule_name": "Transfer Schedule", "scope": "Scope", - "type": "Policy Type", + "type": "Type", "volume": "" } } From 5881fa347df6c46892ab34fe0e81a5e0e5a2e009 Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 18 Dec 2024 16:27:17 +0530 Subject: [PATCH 07/19] feat: add bucket detail in data protection dashboard --- conf/rest/9.7.0/ontap_s3.yaml | 2 + .../cmode/data_protection_snapshot.json | 546 ++++++++++++++++++ 2 files changed, 548 insertions(+) diff --git a/conf/rest/9.7.0/ontap_s3.yaml b/conf/rest/9.7.0/ontap_s3.yaml index 4b44ad31a..588279c92 100644 --- a/conf/rest/9.7.0/ontap_s3.yaml +++ b/conf/rest/9.7.0/ontap_s3.yaml @@ -11,6 +11,7 @@ counters: - ^protection_status.is_protected => is_protected - ^qos_policy.name => qos_policy_group - ^svm.name => svm + - ^type => type - ^volume.name => volume - logical_used_size - size @@ -38,4 +39,5 @@ export_options: - protected_in_cloud - protected_in_ontap - qos_policy_group + - type - url diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection_snapshot.json index 510ce8f30..347b445e7 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection_snapshot.json @@ -1572,6 +1572,552 @@ "x": 0, "y": 2 }, + "id": 24, + "panels": [ + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of unhealthy snapmirrors.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-blue", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 0, + "y": 3 + }, + "id": 104, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Total Buckets", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of unhealthy snapmirrors.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 5, + "y": 3 + }, + "id": 105, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Unprotected Buckets", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of unhealthy snapmirrors.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 10, + "y": 3 + }, + "id": 106, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Not Backed up to Cloud", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel displays volumes detail with snapshot count.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "datacenter" + }, + "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Access Type" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "s3": { + "index": 0, + "text": "S3" + } + }, + "type": "value" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Protected" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Protected" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected in Cloud" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Backed Up" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Backed Up" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected in Ontap" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not In Replication" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "In Replication" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + } + ] + }, + "gridPos": { + "h": 15, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 103, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": false, + "expr": "ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "exemplar": false, + "expr": "ontaps3_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" + }, + { + "exemplar": false, + "expr": "ontaps3_logical_used_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + } + ], + "title": "Buckets", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "bucket", + "cluster", + "datacenter", + "is_protected", + "protected_in_cloud", + "protected_in_ontap", + "svm", + "Value #B", + "Value #C", + "type" + ] + } + } + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": { + "Value #B": 4, + "Value #C": 5, + "bucket": 2, + "cluster": 1, + "datacenter": 0, + "is_protected": 7, + "protected_in_cloud": 8, + "protected_in_ontap": 9, + "svm": 3, + "type": 6 + }, + "renameByName": { + "Value": "Snapshot Copies", + "Value #B": "Size", + "Value #C": "Used", + "bucket": "Name", + "cluster": "", + "comment": "Description", + "cron": "Schedule", + "is_protected": "Protected", + "name": "Name", + "policy_name": "Name", + "protected_in_cloud": "Protected in Cloud", + "protected_in_ontap": "Protected in Ontap", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "svm": "", + "type": "Access Type", + "url": "", + "volume": "" + } + } + } + ], + "type": "table" + } + ], + "title": "Bucket protection", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 + }, "id": 23, "panels": [ { From af3d255ffddb5d6ad2a047202d6530ec5576de2e Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 18 Dec 2024 16:33:07 +0530 Subject: [PATCH 08/19] feat: add bucket detail in data protection dashboard --- .../cmode/data_protection_snapshot.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection_snapshot.json index 347b445e7..1cd6ff0cd 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection_snapshot.json @@ -1576,7 +1576,7 @@ "panels": [ { "datasource": "${DS_PROMETHEUS}", - "description": "Number of unhealthy snapmirrors.", + "description": "Number of total buckets.", "fieldConfig": { "defaults": { "color": { @@ -1643,7 +1643,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of unhealthy snapmirrors.", + "description": "Number of buckets which are not protected.", "fieldConfig": { "defaults": { "color": { @@ -1710,7 +1710,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of unhealthy snapmirrors.", + "description": "Number of buckets which are not backed up to cloud.", "fieldConfig": { "defaults": { "color": { @@ -1777,7 +1777,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with snapshot count.", + "description": "This panel displays bucket detail.", "fieldConfig": { "defaults": { "color": { @@ -1989,7 +1989,7 @@ ] }, "gridPos": { - "h": 15, + "h": 7, "w": 24, "x": 0, "y": 8 @@ -2122,7 +2122,7 @@ "panels": [ { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with snapshot count.", + "description": "This panel displays protection policy detail.", "fieldConfig": { "defaults": { "color": { @@ -2394,7 +2394,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with snapshot count.", + "description": "This panel displays Snapshot policy detail.", "fieldConfig": { "defaults": { "color": { @@ -2662,7 +2662,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with snapshot count.", + "description": "This panel displays cluster schedules detail.", "fieldConfig": { "defaults": { "color": { From b6b90e7d1204015bb696f37c9bb0056e95ddc860 Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 18 Dec 2024 16:48:45 +0530 Subject: [PATCH 09/19] feat: missed file --- conf/rest/9.12.0/snapshotpolicy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index 9a5ccc189..e0342a07c 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -1,5 +1,5 @@ name: SnapshotPolicy -query: api/private/cli/volume/snapshot/policy +query: api/storage/snapshot-policies object: snapshot_policy counters: From b67d9c037962bd4c753096ec04e4f537c8526b36 Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 18 Dec 2024 20:28:13 +0530 Subject: [PATCH 10/19] feat: handled review comments --- .../plugins/snapshotpolicy/snapshotpolicy.go | 21 ++-- cmd/collectors/zapi/collector/zapi.go | 3 + .../plugins/snapshotpolicy/snapshotpolicy.go | 46 ++++++++ cmd/tools/generate/counter.yaml | 3 - conf/rest/9.12.0/snapshotpolicy.yaml | 3 +- conf/zapi/cdot/9.8.0/snapshotpolicy.yaml | 27 +++-- docs/ontap-metrics.md | 10 -- docs/prepare-cdot-clusters.md | 2 +- ...ion_snapshot.json => data_protection.json} | 100 +++++++++++++----- grafana/dashboards/cmode/datacenter.json | 16 +-- integration/test/dashboard_json_test.go | 2 +- 11 files changed, 169 insertions(+), 64 deletions(-) create mode 100644 cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go rename grafana/dashboards/cmode/{data_protection_snapshot.json => data_protection.json} (92%) diff --git a/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go index 4c5fc6781..ee8705a17 100644 --- a/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go +++ b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go @@ -8,6 +8,7 @@ import ( "github.com/netapp/harvest/v2/cmd/poller/plugin" "github.com/netapp/harvest/v2/pkg/matrix" "github.com/netapp/harvest/v2/pkg/util" + "github.com/netapp/harvest/v2/third_party/tidwall/gjson" "strconv" "strings" ) @@ -25,15 +26,19 @@ func (m *SnapshotPolicy) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matri data := dataMap[m.Object] for _, instance := range data.GetInstances() { - copies := strings.Split(instance.GetLabel("copies"), ",") - if len(copies) > 1 { - var copiesValue int - for _, c := range copies { - val, _ := strconv.Atoi(c) - copiesValue += val - } - instance.SetLabel("copies", strconv.Itoa(copiesValue)) + copies := instance.GetLabel("copies") + copiesJSON := gjson.Result{Type: gjson.JSON, Raw: "[" + copies + "]"} + var scheduleVal string + var copiesValue int + for _, copiesData := range copiesJSON.Array() { + count := copiesData.Get("count").String() + countVal, _ := strconv.Atoi(count) + schedule := copiesData.Get("schedule.name").ClonedString() + scheduleVal = scheduleVal + schedule + ":" + count + "," + copiesValue += countVal } + instance.SetLabel("schedules", strings.TrimSuffix(scheduleVal, ",")) + instance.SetLabel("copies", strconv.Itoa(copiesValue)) } return nil, nil, nil diff --git a/cmd/collectors/zapi/collector/zapi.go b/cmd/collectors/zapi/collector/zapi.go index 6d735fead..acc5461fa 100644 --- a/cmd/collectors/zapi/collector/zapi.go +++ b/cmd/collectors/zapi/collector/zapi.go @@ -15,6 +15,7 @@ import ( "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/security" "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/shelf" "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/snapmirror" + "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/snapshotpolicy" "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/svm" "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/systemnode" "github.com/netapp/harvest/v2/cmd/collectors/zapi/plugins/volume" @@ -148,6 +149,8 @@ func (z *Zapi) LoadPlugin(kind string, abc *plugin.AbstractPlugin) plugin.Plugin switch kind { case "Snapmirror": return snapmirror.New(abc) + case "SnapshotPolicy": + return snapshotpolicy.New(abc) case "Shelf": return shelf.New(abc) case "Qtree": diff --git a/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go b/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go new file mode 100644 index 000000000..4f028c29e --- /dev/null +++ b/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go @@ -0,0 +1,46 @@ +/* + * Copyright NetApp Inc, 2024 All rights reserved + */ + +package snapshotpolicy + +import ( + "github.com/netapp/harvest/v2/cmd/poller/plugin" + "github.com/netapp/harvest/v2/pkg/matrix" + "github.com/netapp/harvest/v2/pkg/util" + "strconv" + "strings" +) + +type SnapshotPolicy struct { + *plugin.AbstractPlugin +} + +func New(p *plugin.AbstractPlugin) plugin.Plugin { + return &SnapshotPolicy{AbstractPlugin: p} +} + +func (m *SnapshotPolicy) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, *util.Metadata, error) { + // Purge and reset data + data := dataMap[m.Object] + + for _, instance := range data.GetInstances() { + copies := strings.Split(instance.GetLabel("copies"), ",") + schedules := strings.Split(instance.GetLabel("schedules"), ",") + + var scheduleVal string + var copiesValue int + if len(copies) > 1 { + for index, copiesData := range copies { + countVal, _ := strconv.Atoi(copiesData) + schedule := schedules[index] + scheduleVal = scheduleVal + schedule + ":" + copiesData + "," + copiesValue += countVal + } + instance.SetLabel("schedules", strings.TrimSuffix(scheduleVal, ",")) + instance.SetLabel("copies", strconv.Itoa(copiesValue)) + } + } + + return nil, nil, nil +} diff --git a/cmd/tools/generate/counter.yaml b/cmd/tools/generate/counter.yaml index 7adc1adcf..e69c60326 100644 --- a/cmd/tools/generate/counter.yaml +++ b/cmd/tools/generate/counter.yaml @@ -873,9 +873,6 @@ counters: - Name: snapmirror_update_successful_count Description: Number of Successful Updates - - Name: snapshot_policy_total_schedules - Description: Total Number of Schedules in this Policy - - Name: svm_nfs_read_throughput APIs: - API: REST diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index e0342a07c..1083d868e 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -5,10 +5,9 @@ object: snapshot_policy counters: - ^^uuid => uuid - ^comment => comment - - ^copies.#.count => copies + - ^copies => copies - ^enabled => status - ^name => snapshot_policy - - ^schedules => schedules - ^scope => scope - ^svm.name => svm diff --git a/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml b/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml index 1c9d598bb..324ff7f26 100644 --- a/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml +++ b/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml @@ -2,18 +2,33 @@ name: SnapshotPolicy query: snapshot-policy-get-iter object: snapshot_policy - counters: snapshot-policy-info: - - ^^policy => snapshot_policy - - ^^vserver-name => svm - - ^comment => comment - - total-schedules => total_schedules + - ^^policy => snapshot_policy + - ^^vserver-name => svm + - ^comment => comment + - ^enabled => status + - ^policy-owner => policy_owner + - snapshot-policy-schedules: + - snapshot-schedule-info: + - ^count => copies + - ^schedule => schedules + +plugins: + - LabelAgent: + split: + - policy_owner `-admin` scope, + - SnapshotPolicy export_options: instance_keys: - - comment - snapshot_policy + instance_labels: + - comment + - copies + - schedules + - scope + - status - svm diff --git a/docs/ontap-metrics.md b/docs/ontap-metrics.md index 311683e61..755941bdc 100644 --- a/docs/ontap-metrics.md +++ b/docs/ontap-metrics.md @@ -11503,16 +11503,6 @@ Number of Successful Updates | ZAPI | `snapmirror-get-iter` | `snapmirror-info.update-successful-count` | conf/zapi/cdot/9.8.0/snapmirror.yaml | -### snapshot_policy_total_schedules - -Total Number of Schedules in this Policy - -| API | Endpoint | Metric | Template | -|--------|----------|--------|---------| -| REST | `api/private/cli/volume/snapshot/policy` | `total_schedules` | conf/rest/9.12.0/snapshotpolicy.yaml | -| ZAPI | `snapshot-policy-get-iter` | `snapshot-policy-info.total-schedules` | conf/zapi/cdot/9.8.0/snapshotpolicy.yaml | - - ### svm_cifs_connections Number of connections diff --git a/docs/prepare-cdot-clusters.md b/docs/prepare-cdot-clusters.md index cc74ff16e..a91ca02f4 100644 --- a/docs/prepare-cdot-clusters.md +++ b/docs/prepare-cdot-clusters.md @@ -208,6 +208,7 @@ security login rest-role create -role harvest2-rest-role -access readonly -api / security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/qos/workloads security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/quota/reports security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/shelves + security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/snapshot-policies security login rest-role create -role harvest-rest-role -access readonly -api /api/storage/volumes security login rest-role create -role harvest-rest-role -access readonly -api /api/support/auto-update security login rest-role create -role harvest-rest-role -access readonly -api /api/support/autosupport @@ -235,7 +236,6 @@ security login rest-role create -role harvest2-rest-role -access readonly -api / security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/qos/workload security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/qtree security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/snapmirror - security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/volume/snapshot/policy security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/storage/failover security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/storage/shelf security login rest-role create -role harvest-rest-role -access readonly -api /api/private/cli/system/chassis/fru diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection.json similarity index 92% rename from grafana/dashboards/cmode/data_protection_snapshot.json rename to grafana/dashboards/cmode/data_protection.json index 1cd6ff0cd..701bb5e3a 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -183,7 +183,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": "Volumes protected", @@ -191,7 +191,7 @@ }, { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}))) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "hide": false, "instant": true, "interval": "", @@ -253,7 +253,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -349,7 +349,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": "Volumes breached", @@ -357,7 +357,7 @@ }, { "exemplar": false, - "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", + "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", "instant": true, "interval": "", "legendFormat": "Volumes not breached", @@ -418,7 +418,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -492,7 +492,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}))) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -566,7 +566,7 @@ "targets": [ { "exemplar": false, - "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", + "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", "format": "time_series", "hide": false, "instant": true, @@ -713,7 +713,7 @@ "targets": [ { "exemplar": false, - "expr": "label_replace(label_replace(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", volume!~\"MDV.*\"}, \"Status\", \"Protected\", \"snapshot_policy\", \"(.*)\") , \"Status\", \"Unprotected\", \"snapshot_policy\", \"(none.*)\") * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})", + "expr": "label_replace(label_replace(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", volume!~\"MDV.*\"}, \"Status\", \"Protected\", \"snapshot_policy\", \"(.*)\") , \"Status\", \"Unprotected\", \"snapshot_policy\", \"(none.*)\") * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})", "format": "table", "instant": true, "interval": "", @@ -934,7 +934,7 @@ "targets": [ { "exemplar": false, - "expr": "volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0)", + "expr": "volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0)", "format": "table", "hide": false, "instant": true, @@ -1093,7 +1093,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1156,7 +1156,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1219,7 +1219,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1282,7 +1282,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1504,7 +1504,7 @@ "targets": [ { "exemplar": false, - "expr": "(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0)", + "expr": "(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0)", "format": "table", "instant": true, "interval": "", @@ -1599,7 +1599,7 @@ }, "gridPos": { "h": 5, - "w": 5, + "w": 8, "x": 0, "y": 3 }, @@ -1666,8 +1666,8 @@ }, "gridPos": { "h": 5, - "w": 5, - "x": 5, + "w": 8, + "x": 8, "y": 3 }, "id": 105, @@ -1733,8 +1733,8 @@ }, "gridPos": { "h": 5, - "w": 5, - "x": 10, + "w": 8, + "x": 16, "y": 3 }, "id": 106, @@ -1885,6 +1885,16 @@ } }, "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" } ] } @@ -1913,6 +1923,16 @@ } }, "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" } ] }, @@ -1945,6 +1965,16 @@ } }, "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" } ] }, @@ -1977,6 +2007,16 @@ } }, "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" } ] }, @@ -2332,7 +2372,12 @@ "show": false }, "showHeader": true, - "sortBy": [] + "sortBy": [ + { + "desc": false, + "displayName": "Name" + } + ] }, "pluginVersion": "8.4.11", "targets": [ @@ -2597,7 +2642,12 @@ "show": false }, "showHeader": true, - "sortBy": [] + "sortBy": [ + { + "desc": false, + "displayName": "Status" + } + ] }, "pluginVersion": "8.4.11", "targets": [ @@ -3013,7 +3063,7 @@ ] }, "timezone": "", - "title": "ONTAP: Data Protection Snapshots", - "uid": "cdot-data-protection-snapshots", - "version": 2 + "title": "ONTAP: Data Protection", + "uid": "cdot-data-protection", + "version": 3 } diff --git a/grafana/dashboards/cmode/datacenter.json b/grafana/dashboards/cmode/datacenter.json index 2c4d60d57..f6a793bc4 100644 --- a/grafana/dashboards/cmode/datacenter.json +++ b/grafana/dashboards/cmode/datacenter.json @@ -2980,7 +2980,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": "Volumes protected", @@ -2988,7 +2988,7 @@ }, { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}))) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "hide": false, "instant": true, "interval": "", @@ -3083,7 +3083,7 @@ "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": "Volumes breached", @@ -3091,7 +3091,7 @@ }, { "exemplar": false, - "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", + "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", "instant": true, "interval": "", "legendFormat": "Volumes not breached", @@ -3185,7 +3185,7 @@ "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": " <10 Copies ", @@ -3193,7 +3193,7 @@ }, { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", "instant": true, "interval": "", "legendFormat": "10-100 Copies", @@ -3201,7 +3201,7 @@ }, { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", "hide": false, "instant": true, "interval": "", @@ -3210,7 +3210,7 @@ }, { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_total_schedules{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", "hide": false, "instant": true, "interval": "", diff --git a/integration/test/dashboard_json_test.go b/integration/test/dashboard_json_test.go index fe23a2237..0f9c6222d 100644 --- a/integration/test/dashboard_json_test.go +++ b/integration/test/dashboard_json_test.go @@ -57,7 +57,7 @@ var restCounterMap = map[string]struct{}{ "aggr_snapshot_inode_used_percent": {}, "flexcache_": {}, "rw_ctx_": {}, - "snapshot_policy_total_schedules": {}, + "snapshot_policy_labels": {}, "support_labels": {}, } From 1e23d8cf7e9243e3e6f2e7188065e6a7f2c5d7f0 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 20 Dec 2024 15:20:51 +0530 Subject: [PATCH 11/19] feat: handled review comments --- grafana/dashboards/cmode/data_protection.json | 879 +++++++++++++----- 1 file changed, 622 insertions(+), 257 deletions(-) diff --git a/grafana/dashboards/cmode/data_protection.json b/grafana/dashboards/cmode/data_protection.json index 701bb5e3a..d68037aa9 100644 --- a/grafana/dashboards/cmode/data_protection.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -90,7 +90,7 @@ ], "panels": [ { - "collapsed": true, + "collapsed": false, "datasource": "${DS_PROMETHEUS}", "gridPos": { "h": 1, @@ -98,126 +98,599 @@ "x": 0, "y": 0 }, - "id": 45, - "panels": [ + "id": 15, + "panels": [], + "title": "Highlights", + "type": "row" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of unhealthy snapmirrors.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "links": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-snapmirror/ontap-snapmirror-sources?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}\n" + } + ], + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 0, + "y": 1 + }, + "id": 139, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ { "datasource": "${DS_PROMETHEUS}", - "description": "Volumes Protected With Snapshot Copies (local).", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [] - }, - "overrides": [ + "editorMode": "code", + "exemplar": false, + "expr": "count (count by (relationship_id) (snapmirror_labels{source_cluster=~\"$Cluster\",healthy=\"false\",relationship_id!=\"\"}))", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Unhealthy SnapMirrors", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Total number of snapmirror transfers that have failed.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ { - "matcher": { - "id": "byName", - "options": "Volumes protected" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 5, + "y": 1 + }, + "id": 138, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "sum(snapmirror_break_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_resync_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_update_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}) OR on() vector(0)", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Failed SnapMirror Transfers", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Total number of snapmirror transfers that have been successfully completed without any errors or issues.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ { - "matcher": { - "id": "byName", - "options": "Volumes not protected" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "yellow", - "mode": "fixed" - } - } - ] + "color": "semi-dark-green", + "value": null } ] }, - "gridPos": { - "h": 10, - "w": 6, - "x": 0, - "y": 1 + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 10, + "y": 1 + }, + "id": 137, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "sum(snapmirror_break_successful_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})+sum(snapmirror_resync_successful_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_update_successful_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})OR on() vector(0)", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "range": false, + "refId": "A" + } + ], + "title": "Successful SnapMirror Transfers", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of unprotected volumes.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "id": 12, - "options": { - "legend": { - "displayMode": "hidden", - "placement": "right", - "values": [ - "value" - ] - }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] }, - "pluginVersion": "8.1.2", - "targets": [ - { - "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", - "instant": true, - "interval": "", - "legendFormat": "Volumes protected", - "refId": "A" - }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 5, + "x": 15, + "y": 1 + }, + "id": 148, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\"}) - count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\",isProtected=\"true\",isDestinationOntap=\"true\", svm_root=\"false\"}) or vector(0)", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Volumes aren't replicated", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Total number of volumes that are not protected.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ { - "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", - "hide": false, - "instant": true, - "interval": "", - "legendFormat": "Volumes not protected", - "refId": "B" + "options": { + "match": "null", + "result": { + "color": "rgb(21, 118, 171)", + "text": "0" + } + }, + "type": "special" } ], - "title": "Protected Status", - "transformations": [], - "type": "piechart" + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-yellow", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 20, + "y": 1 + }, + "id": 145, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": false, + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Volumes haven't snapshot policy", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of total buckets.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-blue", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 6 + }, + "id": 151, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes that are protected.", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Total Buckets", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of buckets which are not protected.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 6 + }, + "id": 149, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Unprotected Buckets", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Number of buckets which are not backed up to cloud.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 6 + }, + "id": 150, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Not Backed up to Cloud", + "type": "stat" + }, + { + "collapsed": true, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 45, + "panels": [ + { + "datasource": "${DS_PROMETHEUS}", + "description": "Total number of volumes that are not protected.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [], + "mappings": [ + { + "options": { + "match": "null", + "result": { + "color": "rgb(21, 118, 171)", + "text": "0" + } + }, + "type": "special" + } + ], "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "semi-dark-green", + "color": "dark-yellow", "value": null } ] @@ -229,10 +702,10 @@ "gridPos": { "h": 5, "w": 6, - "x": 6, - "y": 1 + "x": 0, + "y": 12 }, - "id": 75, + "id": 79, "links": [], "options": { "colorMode": "value", @@ -249,11 +722,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -263,114 +736,12 @@ "refId": "A" } ], - "title": "Volumes protected", + "title": "Volumes haven't snapshot policy", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Volumes Breaching Snapshot Copy Reserve Space.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "decimals": 0, - "mappings": [] - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Volumes breached" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "super-light-red", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Volumes not breached" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 1 - }, - "id": 13, - "options": { - "legend": { - "displayMode": "hidden", - "placement": "right", - "values": [ - "value" - ] - }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.1.2", - "targets": [ - { - "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", - "instant": true, - "interval": "", - "legendFormat": "Volumes breached", - "refId": "A" - }, - { - "exemplar": false, - "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", - "instant": true, - "interval": "", - "legendFormat": "Volumes not breached", - "refId": "B" - } - ], - "title": "Breached Status", - "transformations": [], - "type": "piechart" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot size used is breached the snapshot reserve size.", + "description": "Total number of volumes that are protected.", "fieldConfig": { "defaults": { "color": { @@ -382,7 +753,7 @@ "mode": "absolute", "steps": [ { - "color": "light-red", + "color": "semi-dark-green", "value": null } ] @@ -394,10 +765,10 @@ "gridPos": { "h": 5, "w": 6, - "x": 18, - "y": 1 + "x": 6, + "y": 12 }, - "id": 77, + "id": 75, "links": [], "options": { "colorMode": "value", @@ -414,11 +785,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -428,35 +799,24 @@ "refId": "A" } ], - "title": "Volumes breached", + "title": "Volumes haven snapshot policy", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes that are not protected.", + "description": "Total number of volumes whose snapshot size used is breached the snapshot reserve size.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "color": "rgb(21, 118, 171)", - "text": "0" - } - }, - "type": "special" - } - ], + "mappings": [], "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "dark-yellow", + "color": "light-red", "value": null } ] @@ -468,10 +828,10 @@ "gridPos": { "h": 5, "w": 6, - "x": 6, - "y": 6 + "x": 12, + "y": 12 }, - "id": 79, + "id": 77, "links": [], "options": { "colorMode": "value", @@ -488,11 +848,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -502,7 +862,7 @@ "refId": "A" } ], - "title": "Volumes not protected", + "title": "Volumes snapshot size breached", "type": "stat" }, { @@ -543,7 +903,7 @@ "h": 5, "w": 6, "x": 18, - "y": 6 + "y": 12 }, "id": 81, "links": [], @@ -562,7 +922,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, @@ -576,7 +936,7 @@ "refId": "A" } ], - "title": "Volumes not breached", + "title": "Volumes snapshot size not breached", "type": "stat" }, { @@ -695,7 +1055,7 @@ "h": 13, "w": 12, "x": 0, - "y": 11 + "y": 17 }, "id": 83, "options": { @@ -709,7 +1069,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, @@ -914,7 +1274,7 @@ "h": 13, "w": 12, "x": 12, - "y": 11 + "y": 17 }, "id": 91, "interval": "1m", @@ -930,7 +1290,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, @@ -1039,7 +1399,7 @@ "h": 1, "w": 24, "x": 0, - "y": 1 + "y": 12 }, "id": 22, "panels": [ @@ -1570,7 +1930,7 @@ "h": 1, "w": 24, "x": 0, - "y": 2 + "y": 13 }, "id": 24, "panels": [ @@ -2156,7 +2516,7 @@ "h": 1, "w": 24, "x": 0, - "y": 3 + "y": 14 }, "id": 23, "panels": [ @@ -2276,7 +2636,7 @@ }, { "id": "custom.width", - "value": 151 + "value": 156 } ] }, @@ -2288,7 +2648,7 @@ "properties": [ { "id": "custom.width", - "value": 529 + "value": 579 } ] }, @@ -2360,7 +2720,7 @@ "h": 15, "w": 24, "x": 0, - "y": 7 + "y": 15 }, "id": 100, "options": { @@ -2379,7 +2739,7 @@ } ] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, @@ -2516,7 +2876,7 @@ "properties": [ { "id": "custom.width", - "value": 456 + "value": 548 } ] }, @@ -2577,6 +2937,10 @@ { "id": "noValue", "value": "0" + }, + { + "id": "custom.width", + "value": 103 } ] }, @@ -2588,7 +2952,7 @@ "properties": [ { "id": "custom.width", - "value": 215 + "value": 243 } ] }, @@ -2621,6 +2985,10 @@ "type": "value" } ] + }, + { + "id": "custom.width", + "value": 291 } ] } @@ -2630,7 +2998,7 @@ "h": 8, "w": 24, "x": 0, - "y": 22 + "y": 30 }, "id": 101, "options": { @@ -2649,7 +3017,7 @@ } ] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, @@ -2721,11 +3089,8 @@ }, "custom": { "align": "left", - "cellOptions": { - "type": "auto" - }, - "filterable": true, - "inspect": false + "displayMode": "auto", + "filterable": true }, "mappings": [], "thresholds": { @@ -2880,7 +3245,7 @@ "h": 15, "w": 24, "x": 0, - "y": 30 + "y": 38 }, "id": 102, "options": { @@ -2894,7 +3259,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, From 02138577a39da9041acf6b1f0a0c52e25f87d6a9 Mon Sep 17 00:00:00 2001 From: hardikl Date: Mon, 6 Jan 2025 18:58:47 +0530 Subject: [PATCH 12/19] feat: handled UI review comments --- grafana/dashboards/cmode/data_protection.json | 876 ++++-------------- 1 file changed, 158 insertions(+), 718 deletions(-) diff --git a/grafana/dashboards/cmode/data_protection.json b/grafana/dashboards/cmode/data_protection.json index d68037aa9..101d95dfc 100644 --- a/grafana/dashboards/cmode/data_protection.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -105,554 +105,290 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of unhealthy snapmirrors.", + "description": "This panel displays Healthy/Unhealthy SnapMirror relationships count.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true + }, "links": [ { "targetBlank": true, "title": "", - "url": "/d/cdot-snapmirror/ontap-snapmirror-sources?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}\n" + "url": "/d/cdot-snapmirror-destinations/ontap-snapmirror-destinations?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}" } ], "mappings": [], - "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "red", + "color": "green", "value": null } ] }, - "unit": "short" + "unit": "locale" }, "overrides": [] }, "gridPos": { "h": 5, - "w": 5, + "w": 8, "x": 0, "y": 1 }, - "id": 139, - "links": [], + "id": 155, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Object" + } + ] }, "pluginVersion": "8.1.8", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, - "expr": "count (count by (relationship_id) (snapmirror_labels{source_cluster=~\"$Cluster\",healthy=\"false\",relationship_id!=\"\"}))", + "expr": "count(snapmirror_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",healthy=\"true\",relationship_id!=\"\"}) or vector (0)", "format": "time_series", "hide": false, "instant": true, "interval": "", - "intervalFactor": 1, - "legendFormat": "", + "legendFormat": "Healthy", "refId": "A" - } - ], - "title": "Unhealthy SnapMirrors", - "type": "stat" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Total number of snapmirror transfers that have failed.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 5, - "x": 5, - "y": 1 - }, - "id": 138, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "8.1.8", - "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, - "expr": "sum(snapmirror_break_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_resync_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_update_failed_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}) OR on() vector(0)", - "format": "table", + "expr": "count(snapmirror_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",healthy=\"false\",relationship_id!=\"\"}) or vector (0)", + "format": "time_series", "hide": false, "instant": true, "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" + "legendFormat": "Unhealthy", + "refId": "B" } ], - "title": "Failed SnapMirror Transfers", - "type": "stat" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Total number of snapmirror transfers that have been successfully completed without any errors or issues.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "semi-dark-green", - "value": null - } + "title": "SnapMirrors", + "transformations": [ + { + "id": "reduce", + "options": { + "includeTimeField": false, + "mode": "seriesToRows", + "reducers": [ + "lastNotNull" ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 5, - "x": 10, - "y": 1 - }, - "id": 137, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + } }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "8.1.8", - "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", - "exemplar": false, - "expr": "sum(snapmirror_break_successful_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})+sum(snapmirror_resync_successful_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})+sum(snapmirror_update_successful_count{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})OR on() vector(0)", - "format": "table", - "hide": false, - "instant": true, - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "range": false, - "refId": "A" + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Field": "Status", + "Last *": "Count" + } + } } ], - "title": "Successful SnapMirror Transfers", - "type": "stat" + "type": "table" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of unprotected volumes.", + "description": "This panel displays Not replicated/Not protected Volumes count.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true + }, "mappings": [], - "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "yellow", + "color": "green", "value": null + }, + { + "color": "red", + "value": 80 } ] }, - "unit": "short" + "unit": "locale" }, "overrides": [] }, "gridPos": { "h": 5, - "w": 5, - "x": 15, + "w": 8, + "x": 8, "y": 1 }, - "id": 148, - "links": [], + "id": 157, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Object" + } + ] }, "pluginVersion": "8.1.8", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, "expr": "count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\"}) - count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\",isProtected=\"true\",isDestinationOntap=\"true\", svm_root=\"false\"}) or vector(0)", "format": "time_series", "hide": false, - "instant": true, + "instant": false, "interval": "", - "intervalFactor": 1, - "legendFormat": "", + "legendFormat": "Not replicated", "refId": "A" - } - ], - "title": "Volumes aren't replicated", - "type": "stat" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes that are not protected.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "color": "rgb(21, 118, 171)", - "text": "0" - } - }, - "type": "special" - } - ], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-yellow", - "value": null - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 20, - "y": 1 - }, - "id": 145, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.1.8", - "targets": [ { "exemplar": false, "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "format": "time_series", "hide": false, - "instant": true, + "instant": false, "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" + "legendFormat": "Not protected", + "refId": "B" } ], - "title": "Volumes haven't snapshot policy", - "type": "stat" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Number of total buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "semi-dark-blue", - "value": null - } + "title": "Volumes", + "transformations": [ + { + "id": "reduce", + "options": { + "reducers": [ + "lastNotNull" ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 0, - "y": 6 - }, - "id": 151, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + } }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "8.1.8", - "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", - "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Field": "Status", + "Last *": "Count" + } + } } ], - "title": "Total Buckets", - "type": "stat" + "type": "table" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of buckets which are not protected.", + "description": "This panel displays Not protected/Not backed-up to cloud Buckets count.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true + }, "mappings": [], - "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "red", + "color": "green", "value": null + }, + { + "color": "red", + "value": 80 } ] }, - "unit": "short" + "unit": "locale" }, "overrides": [] }, "gridPos": { "h": 5, "w": 8, - "x": 8, - "y": 6 + "x": 16, + "y": 1 }, - "id": 149, - "links": [], + "id": 156, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Object" + } + ] }, "pluginVersion": "8.1.8", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", "format": "time_series", "hide": false, - "instant": true, + "instant": false, "interval": "", - "intervalFactor": 1, - "legendFormat": "", + "legendFormat": "Not protected", "refId": "A" - } - ], - "title": "Unprotected Buckets", - "type": "stat" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Number of buckets which are not backed up to cloud.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 16, - "y": 6 - }, - "id": 150, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "8.1.8", - "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", "format": "time_series", "hide": false, - "instant": true, + "instant": false, "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" + "legendFormat": "Not backed-up to cloud", + "refId": "B" } ], - "title": "Not Backed up to Cloud", - "type": "stat" + "title": "Buckets", + "transformations": [ + { + "id": "reduce", + "options": { + "reducers": [ + "lastNotNull" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Field": "Status", + "Last *": "Count" + } + } + } + ], + "type": "table" }, { "collapsed": true, @@ -661,7 +397,7 @@ "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 6 }, "id": 45, "panels": [ @@ -736,7 +472,7 @@ "refId": "A" } ], - "title": "Volumes haven't snapshot policy", + "title": "Volumes not protected", "type": "stat" }, { @@ -799,7 +535,7 @@ "refId": "A" } ], - "title": "Volumes haven snapshot policy", + "title": "Volumes protected", "type": "stat" }, { @@ -862,7 +598,7 @@ "refId": "A" } ], - "title": "Volumes snapshot size breached", + "title": "Volumes breached", "type": "stat" }, { @@ -936,7 +672,7 @@ "refId": "A" } ], - "title": "Volumes snapshot size not breached", + "title": "Volumes not breached", "type": "stat" }, { @@ -974,10 +710,6 @@ { "id": "custom.filterable", "value": true - }, - { - "id": "custom.width", - "value": 150 } ] }, @@ -991,10 +723,6 @@ "id": "displayName", "value": "Volume" }, - { - "id": "custom.width", - "value": 350 - }, { "id": "links", "value": [ @@ -1007,22 +735,6 @@ } ] }, - { - "matcher": { - "id": "byName", - "options": "snapshot_policy" - }, - "properties": [ - { - "id": "displayName", - "value": "Snapshot Policy" - }, - { - "id": "custom.width", - "value": 220 - } - ] - }, { "matcher": { "id": "byName", @@ -1033,10 +745,6 @@ "id": "displayName", "value": "SVM" }, - { - "id": "custom.width", - "value": 250 - }, { "id": "links", "value": [ @@ -1104,6 +812,9 @@ "snapshot_policy": 2, "svm": 1, "volume": 0 + }, + "renameByName": { + "snapshot_policy": "Snapshot Policy" } } } @@ -1139,10 +850,6 @@ "options": "volume" }, "properties": [ - { - "id": "custom.width", - "value": 320 - }, { "id": "displayName", "value": "Volume" @@ -1172,10 +879,6 @@ { "id": "unit", "value": "bytes" - }, - { - "id": "custom.width", - "value": 130 } ] }, @@ -1192,10 +895,6 @@ { "id": "unit", "value": "bytes" - }, - { - "id": "custom.width", - "value": 130 } ] }, @@ -1235,10 +934,6 @@ { "id": "custom.filterable", "value": true - }, - { - "id": "custom.width", - "value": 150 } ] }, @@ -1252,10 +947,6 @@ "id": "displayName", "value": "SVM" }, - { - "id": "custom.width", - "value": 240 - }, { "id": "links", "value": [ @@ -1387,22 +1078,7 @@ } ], "type": "table" - } - ], - "title": "Snapshot Copies Overview", - "type": "row" - }, - { - "collapsed": true, - "datasource": "${DS_PROMETHEUS}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 12 - }, - "id": 22, - "panels": [ + }, { "datasource": "${DS_PROMETHEUS}", "description": "Total number of volumes whose snapshot count is < 10.", @@ -1430,7 +1106,7 @@ "h": 5, "w": 6, "x": 0, - "y": 2 + "y": 30 }, "id": 96, "links": [], @@ -1493,7 +1169,7 @@ "h": 5, "w": 6, "x": 6, - "y": 2 + "y": 30 }, "id": 97, "links": [], @@ -1556,7 +1232,7 @@ "h": 5, "w": 6, "x": 12, - "y": 2 + "y": 30 }, "id": 98, "links": [], @@ -1619,7 +1295,7 @@ "h": 5, "w": 6, "x": 18, - "y": 2 + "y": 30 }, "id": 99, "links": [], @@ -1740,10 +1416,6 @@ } ] }, - { - "id": "custom.width", - "value": 290 - }, { "id": "displayName", "value": "Snapshot Copies Bucket" @@ -1760,10 +1432,6 @@ "id": "displayName", "value": "Volume" }, - { - "id": "custom.width", - "value": 500 - }, { "id": "links", "value": [ @@ -1786,10 +1454,6 @@ "id": "displayName", "value": "SVM" }, - { - "id": "custom.width", - "value": 500 - }, { "id": "links", "value": [ @@ -1802,18 +1466,6 @@ } ] }, - { - "matcher": { - "id": "byName", - "options": "Snapshot Copies" - }, - "properties": [ - { - "id": "custom.width", - "value": 260 - } - ] - }, { "matcher": { "id": "byName", @@ -1824,10 +1476,6 @@ "id": "displayName", "value": "Cluster" }, - { - "id": "custom.width", - "value": 400 - }, { "id": "links", "value": [ @@ -1846,7 +1494,7 @@ "h": 15, "w": 24, "x": 0, - "y": 7 + "y": 35 }, "id": 94, "options": { @@ -1920,7 +1568,7 @@ "type": "table" } ], - "title": "Snapshot Copies Analysis", + "title": "Snapshot Copies", "type": "row" }, { @@ -1930,7 +1578,7 @@ "h": 1, "w": 24, "x": 0, - "y": 13 + "y": 7 }, "id": 24, "panels": [ @@ -2516,7 +2164,7 @@ "h": 1, "w": 24, "x": 0, - "y": 14 + "y": 8 }, "id": 23, "panels": [ @@ -2617,50 +2265,6 @@ "type": "value" } ] - }, - { - "id": "custom.width", - "value": 179 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Transfer Schedule" - }, - "properties": [ - { - "id": "noValue", - "value": "-" - }, - { - "id": "custom.width", - "value": 156 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Description" - }, - "properties": [ - { - "id": "custom.width", - "value": 579 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Name" - }, - "properties": [ - { - "id": "custom.width", - "value": 260 } ] }, @@ -2670,10 +2274,6 @@ "options": "Scope" }, "properties": [ - { - "id": "custom.width", - "value": 166 - }, { "id": "mappings", "value": [ @@ -2689,30 +2289,6 @@ ] } ] - }, - { - "matcher": { - "id": "byName", - "options": "Datacenter" - }, - "properties": [ - { - "id": "custom.width", - "value": 171 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Cluster" - }, - "properties": [ - { - "id": "custom.width", - "value": 217 - } - ] } ] }, @@ -2868,54 +2444,6 @@ } ] }, - { - "matcher": { - "id": "byName", - "options": "Description" - }, - "properties": [ - { - "id": "custom.width", - "value": 548 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Scope" - }, - "properties": [ - { - "id": "custom.width", - "value": 124 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Datacenter" - }, - "properties": [ - { - "id": "custom.width", - "value": 171 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Cluster" - }, - "properties": [ - { - "id": "custom.width", - "value": 217 - } - ] - }, { "matcher": { "id": "byName", @@ -2937,22 +2465,6 @@ { "id": "noValue", "value": "0" - }, - { - "id": "custom.width", - "value": 103 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Policy Name" - }, - "properties": [ - { - "id": "custom.width", - "value": 243 } ] }, @@ -2985,10 +2497,6 @@ "type": "value" } ] - }, - { - "id": "custom.width", - "value": 291 } ] } @@ -3172,70 +2680,6 @@ "type": "value" } ] - }, - { - "id": "custom.width", - "value": 152 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Description" - }, - "properties": [ - { - "id": "custom.width", - "value": 306 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Name" - }, - "properties": [ - { - "id": "custom.width", - "value": 360 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Scope" - }, - "properties": [ - { - "id": "custom.width", - "value": 124 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Datacenter" - }, - "properties": [ - { - "id": "custom.width", - "value": 171 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Cluster" - }, - "properties": [ - { - "id": "custom.width", - "value": 233 } ] } @@ -3317,7 +2761,7 @@ "type": "table" } ], - "title": "Local policy settings", + "title": "Local Policy", "type": "row" } ], @@ -3354,11 +2798,7 @@ }, { "allValue": null, - "current": { - "selected": false, - "text": "DC-01", - "value": "DC-01" - }, + "current": {}, "datasource": "${DS_PROMETHEUS}", "definition": "label_values(cluster_new_status{system_type!=\"7mode\"},datacenter)", "description": null, From 5e12216f7f4dad9b7fa1057253e3d4e5552b84a1 Mon Sep 17 00:00:00 2001 From: hardikl Date: Mon, 6 Jan 2025 19:15:09 +0530 Subject: [PATCH 13/19] feat: handled UI review comments --- grafana/dashboards/cmode/data_protection.json | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/grafana/dashboards/cmode/data_protection.json b/grafana/dashboards/cmode/data_protection.json index 101d95dfc..324d5c2e8 100644 --- a/grafana/dashboards/cmode/data_protection.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -116,13 +116,6 @@ "displayMode": "auto", "filterable": true }, - "links": [ - { - "targetBlank": true, - "title": "", - "url": "/d/cdot-snapmirror-destinations/ontap-snapmirror-destinations?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}" - } - ], "mappings": [], "thresholds": { "mode": "absolute", @@ -135,7 +128,26 @@ }, "unit": "locale" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Count" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-snapmirror-destinations/ontap-snapmirror-destinations?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}" + } + ] + } + ] + } + ] }, "gridPos": { "h": 5, From f10c8a80bc94405992f5fde85be1a2be31aced1c Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Wed, 8 Jan 2025 02:31:21 -0500 Subject: [PATCH 14/19] feat: adding the bucket and policy rest template to the data protection dashboard (#3414) --- .../clusterschedule/clusterschedule.go | 36 +++++++++---------- .../plugins/snapshotpolicy/snapshotpolicy.go | 12 ++++--- .../plugins/snapshotpolicy/snapshotpolicy.go | 11 ++++-- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go index 6447ddd55..4736860ef 100644 --- a/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go +++ b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go @@ -26,24 +26,10 @@ func (c *ClusterScheule) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matri cron := instance.GetLabel("cron") updateDetailsJSON := gjson.Result{Type: gjson.JSON, Raw: cron} var cronVal, minStr, hourStr, weekDayStr string - if minutes := updateDetailsJSON.Get("minutes"); minutes.Exists() { - for _, m := range minutes.Array() { - minStr = minStr + m.String() + ", " - } - minStr = strings.TrimSuffix(minStr, ", ") - } - if hours := updateDetailsJSON.Get("hours"); hours.Exists() { - for _, h := range hours.Array() { - hourStr = hourStr + h.String() + ", " - } - hourStr = strings.TrimSuffix(hourStr, ", ") - } - if weekdays := updateDetailsJSON.Get("weekdays"); weekdays.Exists() { - for _, w := range weekdays.Array() { - weekDayStr = weekDayStr + w.String() + ", " - } - weekDayStr = strings.TrimSuffix(weekDayStr, ", ") - } + + minStr = list(updateDetailsJSON.Get("minutes")) + hourStr = list(updateDetailsJSON.Get("hours")) + weekDayStr = list(updateDetailsJSON.Get("weekdays")) if minStr != "" { cronVal = cronVal + "minutes: " + "[" + minStr + "] " @@ -54,7 +40,19 @@ func (c *ClusterScheule) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matri if weekDayStr != "" { cronVal = cronVal + "weekdays: " + "[" + weekDayStr + "]" } - instance.SetLabel("cron", cronVal) + instance.SetLabel("cron", strings.TrimSpace(cronVal)) } return nil, nil, nil } + +func list(get gjson.Result) string { + if !get.IsArray() { + return "" + } + array := get.Array() + items := make([]string, 0, len(array)) + for _, e := range array { + items = append(items, e.ClonedString()) + } + return strings.Join(items, ", ") +} diff --git a/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go index ee8705a17..d44f83a0b 100644 --- a/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go +++ b/cmd/collectors/rest/plugins/snapshotpolicy/snapshotpolicy.go @@ -9,6 +9,7 @@ import ( "github.com/netapp/harvest/v2/pkg/matrix" "github.com/netapp/harvest/v2/pkg/util" "github.com/netapp/harvest/v2/third_party/tidwall/gjson" + "slices" "strconv" "strings" ) @@ -28,16 +29,19 @@ func (m *SnapshotPolicy) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matri for _, instance := range data.GetInstances() { copies := instance.GetLabel("copies") copiesJSON := gjson.Result{Type: gjson.JSON, Raw: "[" + copies + "]"} - var scheduleVal string var copiesValue int + var schedules []string for _, copiesData := range copiesJSON.Array() { - count := copiesData.Get("count").String() + count := copiesData.Get("count").ClonedString() countVal, _ := strconv.Atoi(count) schedule := copiesData.Get("schedule.name").ClonedString() - scheduleVal = scheduleVal + schedule + ":" + count + "," + schedules = append(schedules, schedule+":"+count) copiesValue += countVal } - instance.SetLabel("schedules", strings.TrimSuffix(scheduleVal, ",")) + + slices.Sort(schedules) + + instance.SetLabel("schedules", strings.Join(schedules, ",")) instance.SetLabel("copies", strconv.Itoa(copiesValue)) } diff --git a/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go b/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go index 4f028c29e..c4981b484 100644 --- a/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go +++ b/cmd/collectors/zapi/plugins/snapshotpolicy/snapshotpolicy.go @@ -8,6 +8,7 @@ import ( "github.com/netapp/harvest/v2/cmd/poller/plugin" "github.com/netapp/harvest/v2/pkg/matrix" "github.com/netapp/harvest/v2/pkg/util" + "slices" "strconv" "strings" ) @@ -27,17 +28,21 @@ func (m *SnapshotPolicy) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matri for _, instance := range data.GetInstances() { copies := strings.Split(instance.GetLabel("copies"), ",") schedules := strings.Split(instance.GetLabel("schedules"), ",") + var schedulesS []string - var scheduleVal string var copiesValue int if len(copies) > 1 { for index, copiesData := range copies { countVal, _ := strconv.Atoi(copiesData) schedule := schedules[index] - scheduleVal = scheduleVal + schedule + ":" + copiesData + "," + schedulesS = append(schedulesS, schedule+":"+copiesData) + copiesValue += countVal } - instance.SetLabel("schedules", strings.TrimSuffix(scheduleVal, ",")) + + slices.Sort(schedulesS) + + instance.SetLabel("schedules", strings.Join(schedulesS, ",")) instance.SetLabel("copies", strconv.Itoa(copiesValue)) } } From 18336a5a529a2ef437246437913881d5468541aa Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 8 Jan 2025 17:03:57 +0530 Subject: [PATCH 15/19] feat: handled UI review comments --- .../clusterschedule/clusterschedule.go | 41 ++++++++----------- conf/rest/9.12.0/snapshotpolicy.yaml | 4 +- conf/rest/9.6.0/clusterschedule.yaml | 1 + conf/zapi/cdot/9.8.0/snapshotpolicy.yaml | 4 +- grafana/dashboards/cmode/data_protection.json | 15 ++++--- 5 files changed, 30 insertions(+), 35 deletions(-) diff --git a/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go index 4736860ef..a8badaf4c 100644 --- a/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go +++ b/cmd/collectors/rest/plugins/clusterschedule/clusterschedule.go @@ -1,12 +1,10 @@ package clusterschedule import ( - "github.com/netapp/harvest/v2/cmd/collectors" "github.com/netapp/harvest/v2/cmd/poller/plugin" "github.com/netapp/harvest/v2/pkg/matrix" "github.com/netapp/harvest/v2/pkg/util" "github.com/netapp/harvest/v2/third_party/tidwall/gjson" - "strconv" "strings" ) @@ -20,39 +18,36 @@ func New(p *plugin.AbstractPlugin) plugin.Plugin { func (c *ClusterScheule) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, *util.Metadata, error) { for _, instance := range dataMap[c.Object].GetInstances() { - intervalVal := collectors.HandleDuration(instance.GetLabel("interval")) - instance.SetLabel("interval", strconv.FormatFloat(intervalVal, 'f', -1, 64)) - - cron := instance.GetLabel("cron") - updateDetailsJSON := gjson.Result{Type: gjson.JSON, Raw: cron} - var cronVal, minStr, hourStr, weekDayStr string - - minStr = list(updateDetailsJSON.Get("minutes")) - hourStr = list(updateDetailsJSON.Get("hours")) - weekDayStr = list(updateDetailsJSON.Get("weekdays")) - - if minStr != "" { - cronVal = cronVal + "minutes: " + "[" + minStr + "] " - } - if hourStr != "" { - cronVal = cronVal + "hours: " + "[" + hourStr + "] " + if cron := instance.GetLabel("cron"); cron != "" { + updateDetailsJSON := gjson.Result{Type: gjson.JSON, Raw: cron} + var minStr, hourStr, dayStr, monthStr, weekDayStr string + var cronVal []string + + minStr = list(updateDetailsJSON.Get("minutes")) + hourStr = list(updateDetailsJSON.Get("hours")) + dayStr = list(updateDetailsJSON.Get("days")) + monthStr = list(updateDetailsJSON.Get("months")) + weekDayStr = list(updateDetailsJSON.Get("weekdays")) + cronVal = append(cronVal, minStr, hourStr, dayStr, monthStr, weekDayStr) + cronData := strings.Join(cronVal, " ") + instance.SetLabel("cron", cronData) + instance.SetLabel("schedule", cronData) } - if weekDayStr != "" { - cronVal = cronVal + "weekdays: " + "[" + weekDayStr + "]" + if interval := instance.GetLabel("interval"); interval != "" { + instance.SetLabel("schedule", interval) } - instance.SetLabel("cron", strings.TrimSpace(cronVal)) } return nil, nil, nil } func list(get gjson.Result) string { if !get.IsArray() { - return "" + return "*" } array := get.Array() items := make([]string, 0, len(array)) for _, e := range array { items = append(items, e.ClonedString()) } - return strings.Join(items, ", ") + return strings.Join(items, ",") } diff --git a/conf/rest/9.12.0/snapshotpolicy.yaml b/conf/rest/9.12.0/snapshotpolicy.yaml index 1083d868e..b9dc84574 100644 --- a/conf/rest/9.12.0/snapshotpolicy.yaml +++ b/conf/rest/9.12.0/snapshotpolicy.yaml @@ -6,7 +6,7 @@ counters: - ^^uuid => uuid - ^comment => comment - ^copies => copies - - ^enabled => status + - ^enabled => enabled - ^name => snapshot_policy - ^scope => scope - ^svm.name => svm @@ -20,8 +20,8 @@ export_options: instance_labels: - comment - copies + - enabled - schedules - scope - - status - svm diff --git a/conf/rest/9.6.0/clusterschedule.yaml b/conf/rest/9.6.0/clusterschedule.yaml index 29699d460..24e52d802 100644 --- a/conf/rest/9.6.0/clusterschedule.yaml +++ b/conf/rest/9.6.0/clusterschedule.yaml @@ -21,6 +21,7 @@ export_options: instance_labels: - cron - interval + - schedule - scope - svm diff --git a/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml b/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml index 324ff7f26..c9b4d445a 100644 --- a/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml +++ b/conf/zapi/cdot/9.8.0/snapshotpolicy.yaml @@ -7,7 +7,7 @@ counters: - ^^policy => snapshot_policy - ^^vserver-name => svm - ^comment => comment - - ^enabled => status + - ^enabled => enabled - ^policy-owner => policy_owner - snapshot-policy-schedules: - snapshot-schedule-info: @@ -26,9 +26,9 @@ export_options: instance_labels: - comment - copies + - enabled - schedules - scope - - status - svm diff --git a/grafana/dashboards/cmode/data_protection.json b/grafana/dashboards/cmode/data_protection.json index 324d5c2e8..11647c183 100644 --- a/grafana/dashboards/cmode/data_protection.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -2147,7 +2147,6 @@ "bucket": "Name", "cluster": "", "comment": "Description", - "cron": "Schedule", "is_protected": "Protected", "name": "Name", "policy_name": "Name", @@ -2483,7 +2482,7 @@ { "matcher": { "id": "byName", - "options": "Status" + "options": "Enabled" }, "properties": [ { @@ -2533,7 +2532,7 @@ "sortBy": [ { "desc": false, - "displayName": "Status" + "displayName": "Enabled" } ] }, @@ -2560,7 +2559,7 @@ "comment", "datacenter", "snapshot_policy", - "status", + "enabled", "copies", "svm" ] @@ -2576,19 +2575,19 @@ "comment": 3, "copies": 6, "datacenter": 0, + "enabled": 4, "snapshot_policy": 2, - "status": 4, "svm": 5 }, "renameByName": { "Value": "Snapshot Copies", "cluster": "", "comment": "Description", + "enabled": "Enabled", "policy_name": "Name", "schedule_name": "Transfer Schedule", "scope": "Scope", "snapshot_policy": "Policy Name", - "status": "Status", "svm": "Scope", "type": "Policy Type", "volume": "" @@ -2735,7 +2734,7 @@ "include": { "names": [ "cluster", - "cron", + "schedule", "datacenter", "name", "type", @@ -2759,9 +2758,9 @@ "Value": "Snapshot Copies", "cluster": "", "comment": "Description", - "cron": "Schedule", "name": "Name", "policy_name": "Name", + "schedule": "Schedule", "schedule_name": "Transfer Schedule", "scope": "Scope", "type": "Type", From b39e3c90efdf25ebde7137de37f727f4acf3b641 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 10 Jan 2025 15:58:45 +0530 Subject: [PATCH 16/19] feat: update highlight panel --- grafana/dashboards/cmode/data_protection.json | 2188 ++++++++++------- 1 file changed, 1333 insertions(+), 855 deletions(-) diff --git a/grafana/dashboards/cmode/data_protection.json b/grafana/dashboards/cmode/data_protection.json index 11647c183..13ccf1c85 100644 --- a/grafana/dashboards/cmode/data_protection.json +++ b/grafana/dashboards/cmode/data_protection.json @@ -105,391 +105,772 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays Healthy/Unhealthy SnapMirror relationships count.", + "description": "This panel displays volume protection by Snapshot copies.", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "displayMode": "auto", - "filterable": true + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } }, + "decimals": 0, "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "unit": "locale" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Not Protected" + }, + "properties": [ { - "color": "green", - "value": null + "id": "color", + "value": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + } } ] }, - "unit": "locale" - }, - "overrides": [ { "matcher": { "id": "byName", - "options": "Count" + "options": "Protected" }, "properties": [ { - "id": "links", - "value": [ - { - "targetBlank": true, - "title": "", - "url": "/d/cdot-snapmirror-destinations/ontap-snapmirror-destinations?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}" - } - ] + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } } ] } ] }, "gridPos": { - "h": 5, + "h": 10, "w": 8, "x": 0, "y": 1 }, "id": 155, "options": { - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "Object" - } - ] + "displayLabels": [ + "value", + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "values": [ + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single" + } }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.1.2", "targets": [ { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count(snapmirror_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",healthy=\"true\",relationship_id!=\"\"}) or vector (0)", - "format": "time_series", - "hide": false, + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",type=\"rw\",state!=\"\"}) or vector(1)", "instant": true, "interval": "", - "legendFormat": "Healthy", + "legendFormat": "Total", "refId": "A" }, { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count(snapmirror_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",healthy=\"false\",relationship_id!=\"\"}) or vector (0)", - "format": "time_series", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",type=\"rw\",state!=\"\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"}) OR on() vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Unhealthy", + "legendFormat": "Not Protected", "refId": "B" } ], - "title": "SnapMirrors", + "title": "Snapshot copies (local)", "transformations": [ { - "id": "reduce", + "id": "calculateField", "options": { - "includeTimeField": false, - "mode": "seriesToRows", - "reducers": [ - "lastNotNull" - ] + "alias": "Protected", + "binary": { + "left": "Total", + "operator": "-", + "reducer": "sum", + "right": "Not Protected" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": false } }, { "id": "organize", "options": { - "excludeByName": {}, + "excludeByName": { + "Time": true, + "Total": true + }, "indexByName": {}, - "renameByName": { - "Field": "Status", - "Last *": "Count" - } + "renameByName": {} } } ], - "type": "table" + "type": "piechart" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays Not replicated/Not protected Volumes count.", + "description": "This panel displays volume protection by SnapMirror relationship.", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "displayMode": "auto", - "filterable": true + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } }, + "decimals": 0, "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, + "unit": "locale" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Not Protected" + }, + "properties": [ { - "color": "red", - "value": 80 + "id": "color", + "value": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + } } ] }, - "unit": "locale" - }, - "overrides": [] + { + "matcher": { + "id": "byName", + "options": "Protected" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 10, "w": 8, "x": 8, "y": 1 }, "id": 157, "options": { - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "Object" - } - ] + "displayLabels": [ + "value", + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "values": [ + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single" + } }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.1.2", "targets": [ { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\"}) - count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\",isProtected=\"true\",isDestinationOntap=\"true\", svm_root=\"false\"}) or vector(0)", - "format": "time_series", - "hide": false, - "instant": false, + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",type=\"rw\",state!=\"\"}) or vector(1)", + "instant": true, "interval": "", - "legendFormat": "Not replicated", + "legendFormat": "Total", "refId": "A" }, { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", - "format": "time_series", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",type=\"rw\",state!=\"\",isProtected=\"true\",isDestinationOntap=\"true\", svm_root=\"false\"}) or vector(0)", "hide": false, - "instant": false, + "instant": true, "interval": "", - "legendFormat": "Not protected", + "legendFormat": "Protected", "refId": "B" } ], - "title": "Volumes", + "title": "SnapMirrors (local or remote)", "transformations": [ { - "id": "reduce", + "id": "calculateField", "options": { - "reducers": [ - "lastNotNull" - ] + "alias": "Not Protected", + "binary": { + "left": "Total", + "operator": "-", + "reducer": "sum", + "right": "Protected" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": false } }, { "id": "organize", "options": { - "excludeByName": {}, + "excludeByName": { + "Time": true, + "Total": true + }, "indexByName": {}, - "renameByName": { - "Field": "Status", - "Last *": "Count" - } + "renameByName": {} } } ], - "type": "table" + "type": "piechart" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays Not protected/Not backed-up to cloud Buckets count.", + "description": "This panel displays volume protection by backed up to cloud bucket.", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "displayMode": "auto", - "filterable": true + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } }, + "decimals": 0, "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, + "unit": "locale" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Not Protected" + }, + "properties": [ { - "color": "red", - "value": 80 + "id": "color", + "value": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + } } ] }, - "unit": "locale" - }, - "overrides": [] + { + "matcher": { + "id": "byName", + "options": "Protected" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 10, "w": 8, "x": 16, "y": 1 }, "id": 156, "options": { - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "Object" - } - ] + "displayLabels": [ + "value", + "percent" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "values": [ + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single" + } }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.1.2", "targets": [ { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", - "format": "time_series", - "hide": false, - "instant": false, + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",state!=\"\"}) or vector(1)", + "instant": true, "interval": "", - "legendFormat": "Not protected", + "legendFormat": "Total", "refId": "A" }, { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", - "format": "time_series", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",state!=\"\",isProtected=\"true\", isDestinationCloud=\"true\", svm_root=\"false\"}) or vector(0)", "hide": false, - "instant": false, + "instant": true, "interval": "", - "legendFormat": "Not backed-up to cloud", + "legendFormat": "Protected", "refId": "B" } ], - "title": "Buckets", + "title": "Back up to cloud", "transformations": [ { - "id": "reduce", + "id": "calculateField", "options": { - "reducers": [ - "lastNotNull" - ] + "alias": "Not Protected", + "binary": { + "left": "Total", + "operator": "-", + "reducer": "sum", + "right": "Protected" + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": false } }, { "id": "organize", "options": { - "excludeByName": {}, + "excludeByName": { + "Time": true, + "Total": true + }, "indexByName": {}, - "renameByName": { - "Field": "Status", - "Last *": "Count" - } + "renameByName": {} } } ], - "type": "table" + "type": "piechart" }, { - "collapsed": true, "datasource": "${DS_PROMETHEUS}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 6 - }, - "id": 45, - "panels": [ - { - "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes that are not protected.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "description": "This panel displays volume protection detail via Snapshot, SnapMirror or Bucket.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "color": "rgb(21, 118, 171)", - "text": "0" - } - }, - "type": "special" - } - ], - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ + { + "id": "links", + "value": [ { - "color": "dark-yellow", - "value": null + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" } ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 6, - "x": 0, - "y": 12 + } + ] }, - "id": 79, - "links": [], - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + { + "matcher": { + "id": "byName", + "options": "datacenter" }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.1.8", - "targets": [ - { - "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", - "format": "time_series", - "hide": false, - "instant": true, - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } + "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "custom.width", + "value": null + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Protected" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Protected" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected in Cloud" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Backed Up" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Backed Up" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Protected in Ontap" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not In Replication" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "In Replication" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" + } + ] + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 162, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" ], - "title": "Volumes not protected", - "type": "stat" + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": false, + "expr": "volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Volumes", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "cluster", + "datacenter", + "svm", + "isDestinationCloud", + "isDestinationOntap", + "isProtected", + "snapshot_policy", + "volume" + ] + } + } }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": { + "cluster": 1, + "datacenter": 0, + "isDestinationCloud": 5, + "isDestinationOntap": 6, + "isProtected": 7, + "snapshot_policy": 4, + "svm": 2, + "volume": 3 + }, + "renameByName": { + "Value": "Snapshot Copies", + "Value #B": "Size", + "Value #C": "Used", + "bucket": "Name", + "cluster": "", + "comment": "Description", + "datacenter": "", + "isDestinationCloud": "Protected in Cloud", + "isDestinationOntap": "Protected in Ontap", + "isProtected": "Protected", + "is_protected": "Protected", + "name": "Name", + "policy_name": "Name", + "protected_in_cloud": "Protected in Cloud", + "protected_in_ontap": "Protected in Ontap", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "snapshot_policy": "Snapshot Policy", + "svm": "", + "type": "", + "url": "", + "volume": "" + } + } + } + ], + "type": "table" + }, + { + "collapsed": true, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 24, + "panels": [ { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes that are protected.", + "description": "Number of total buckets.", "fieldConfig": { "defaults": { "color": { @@ -501,7 +882,7 @@ "mode": "absolute", "steps": [ { - "color": "semi-dark-green", + "color": "semi-dark-blue", "value": null } ] @@ -512,11 +893,11 @@ }, "gridPos": { "h": 5, - "w": 6, - "x": 6, - "y": 12 + "w": 8, + "x": 0, + "y": 3 }, - "id": 75, + "id": 104, "links": [], "options": { "colorMode": "value", @@ -530,14 +911,18 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, "pluginVersion": "8.1.8", "targets": [ { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})", "format": "time_series", "hide": false, "instant": true, @@ -547,12 +932,12 @@ "refId": "A" } ], - "title": "Volumes protected", + "title": "Total Buckets", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot size used is breached the snapshot reserve size.", + "description": "Number of buckets which are not protected.", "fieldConfig": { "defaults": { "color": { @@ -564,7 +949,7 @@ "mode": "absolute", "steps": [ { - "color": "light-red", + "color": "red", "value": null } ] @@ -575,11 +960,11 @@ }, "gridPos": { "h": 5, - "w": 6, - "x": 12, - "y": 12 + "w": 8, + "x": 8, + "y": 3 }, - "id": 77, + "id": 105, "links": [], "options": { "colorMode": "value", @@ -593,14 +978,18 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, "pluginVersion": "8.1.8", "targets": [ { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", "exemplar": false, - "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", "format": "time_series", "hide": false, "instant": true, @@ -610,35 +999,24 @@ "refId": "A" } ], - "title": "Volumes breached", + "title": "Unprotected Buckets", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot size used is not breached the snapshot reserve size.", + "description": "Number of buckets which are not backed up to cloud.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "color": "rgb(21, 118, 171)", - "text": "0" - } - }, - "type": "special" - } - ], + "mappings": [], "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "semi-dark-green", + "color": "red", "value": null } ] @@ -649,11 +1027,11 @@ }, "gridPos": { "h": 5, - "w": 6, - "x": 18, - "y": 12 + "w": 8, + "x": 16, + "y": 3 }, - "id": 81, + "id": 106, "links": [], "options": { "colorMode": "value", @@ -667,14 +1045,18 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, "pluginVersion": "8.1.8", "targets": [ { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", "exemplar": false, - "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", + "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", "format": "time_series", "hide": false, "instant": true, @@ -684,12 +1066,12 @@ "refId": "A" } ], - "title": "Volumes not breached", + "title": "Not Backed up to Cloud", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with protected status and snapshot policy.", + "description": "This panel displays bucket detail.", "fieldConfig": { "defaults": { "color": { @@ -697,7 +1079,7 @@ "mode": "fixed" }, "custom": { - "align": "auto", + "align": "left", "displayMode": "auto", "filterable": true }, @@ -710,30 +1092,41 @@ "value": null } ] - } + }, + "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", - "options": "Status" + "options": "cluster" }, "properties": [ { - "id": "custom.filterable", - "value": true + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] } ] }, { "matcher": { "id": "byName", - "options": "volume" + "options": "datacenter" }, "properties": [ { "id": "displayName", - "value": "Volume" + "value": "Datacenter" }, { "id": "links", @@ -741,7 +1134,7 @@ { "targetBlank": true, "title": "", - "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" } ] } @@ -768,111 +1161,34 @@ ] } ] - } - ] - }, - "gridPos": { - "h": 13, - "w": 12, - "x": 0, - "y": 17 - }, - "id": 83, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "8.1.8", - "targets": [ - { - "exemplar": false, - "expr": "label_replace(label_replace(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", volume!~\"MDV.*\"}, \"Status\", \"Protected\", \"snapshot_policy\", \"(.*)\") , \"Status\", \"Unprotected\", \"snapshot_policy\", \"(none.*)\") * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Volumes Protected With Snapshot Copies (local)", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "snapshot_policy", - "volume", - "Status", - "svm" - ] - } - } - }, - { - "id": "organize", - "options": { - "indexByName": { - "Status": 3, - "snapshot_policy": 2, - "svm": 1, - "volume": 0 - }, - "renameByName": { - "snapshot_policy": "Snapshot Policy" - } - } - } - ], - "type": "table" - }, - { - "datasource": "${DS_PROMETHEUS}", - "description": "Volumes details of snapshot copy reserve space.", - "fieldConfig": { - "defaults": { - "custom": { - "align": "left", - "displayMode": "auto", - "filterable": true - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgb(31, 176, 196)", - "value": null - } - ] }, - "unit": "none" - }, - "overrides": [ { "matcher": { "id": "byName", - "options": "volume" + "options": "Access Type" }, "properties": [ { - "id": "displayName", - "value": "Volume" - }, - { - "id": "links", + "id": "mappings", "value": [ { - "targetBlank": true, - "title": "", - "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + "options": { + "s3": { + "index": 0, + "text": "S3" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" } ] } @@ -881,39 +1197,91 @@ { "matcher": { "id": "byName", - "options": "Value #B" + "options": "Protected" }, "properties": [ { - "id": "displayName", - "value": "Used" + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Protected" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Protected" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" + } + ] }, { - "id": "unit", - "value": "bytes" + "id": "custom.displayMode", + "value": "color-background-solid" } ] }, { "matcher": { "id": "byName", - "options": "Value #A" + "options": "Protected in Cloud" }, "properties": [ { - "id": "displayName", - "value": "Reserved" + "id": "mappings", + "value": [ + { + "options": { + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not Backed Up" + }, + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "Backed Up" + } + }, + "type": "value" + }, + { + "options": { + "match": "empty", + "result": { + "index": 2, + "text": "Not Supported" + } + }, + "type": "special" + } + ] }, { - "id": "unit", - "value": "bytes" + "id": "custom.displayMode", + "value": "color-background-solid" } ] }, { "matcher": { "id": "byName", - "options": "Status" + "options": "Protected in Ontap" }, "properties": [ { @@ -921,51 +1289,55 @@ "value": [ { "options": { - "from": -1e+25, - "result": { - "index": 0, - "text": "Not Breached" + "false": { + "color": "semi-dark-red", + "index": 1, + "text": "Not In Replication" }, - "to": 0 + "true": { + "color": "semi-dark-green", + "index": 0, + "text": "In Replication" + } }, - "type": "range" + "type": "value" }, { "options": { - "from": 0, + "match": "empty", "result": { - "index": 1, - "text": "Breached" - }, - "to": 1e+25 + "index": 2, + "text": "Not Supported" + } }, - "type": "range" + "type": "special" } ] }, { - "id": "custom.filterable", - "value": true + "id": "custom.displayMode", + "value": "color-background-solid" } ] }, { "matcher": { "id": "byName", - "options": "svm" + "options": "Used" }, "properties": [ { - "id": "displayName", - "value": "SVM" - }, - { - "id": "links", + "id": "mappings", "value": [ { - "targetBlank": true, - "title": "", - "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + "options": { + "match": "null", + "result": { + "index": 0, + "text": "Not used" + } + }, + "type": "special" } ] } @@ -974,14 +1346,12 @@ ] }, "gridPos": { - "h": 13, - "w": 12, - "x": 12, - "y": 17 + "h": 7, + "w": 24, + "x": 0, + "y": 8 }, - "id": 91, - "interval": "1m", - "maxDataPoints": 2, + "id": 103, "options": { "footer": { "fields": "", @@ -997,115 +1367,141 @@ "targets": [ { "exemplar": false, - "expr": "volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0)", + "expr": "ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", "format": "table", - "hide": false, "instant": true, "interval": "", - "intervalFactor": 1, "legendFormat": "", "refId": "A" }, { "exemplar": false, - "expr": "volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}", + "expr": "ontaps3_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", "format": "table", "hide": false, "instant": true, "interval": "", "legendFormat": "", "refId": "B" + }, + { + "exemplar": false, + "expr": "ontaps3_logical_used_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" } ], - "title": "Volumes Breaching Snapshot Copy Reserve Space", + "title": "Buckets", "transformations": [ - { - "id": "merge", - "options": {} - }, - { - "id": "filterByValue", - "options": { - "filters": [ - { - "config": { - "id": "greaterOrEqual", - "options": { - "value": 0 - } - }, - "fieldName": "Value #A" - } - ], - "match": "all", - "type": "include" - } - }, { "id": "filterFieldsByName", "options": { "include": { "names": [ - "volume", - "Value #A", + "bucket", + "cluster", + "datacenter", + "is_protected", + "protected_in_cloud", + "protected_in_ontap", + "svm", "Value #B", - "svm" + "Value #C", + "type" ] } } }, { - "id": "calculateField", - "options": { - "alias": "Status", - "binary": { - "left": "Value #B", - "operator": "-", - "reducer": "sum", - "right": "Value #A" - }, - "mode": "binary", - "reduce": { - "include": [ - "Value #A", - "Value #B" - ], - "reducer": "sum" - } - } + "id": "merge", + "options": {} }, { "id": "organize", "options": { "excludeByName": {}, + "includeByName": {}, "indexByName": { - "Status": 4, - "Value #A": 2, - "Value #B": 3, - "svm": 1, - "volume": 0 + "Value #B": 4, + "Value #C": 5, + "bucket": 2, + "cluster": 1, + "datacenter": 0, + "is_protected": 7, + "protected_in_cloud": 8, + "protected_in_ontap": 9, + "svm": 3, + "type": 6 }, - "renameByName": {} + "renameByName": { + "Value": "Snapshot Copies", + "Value #B": "Size", + "Value #C": "Used", + "bucket": "Name", + "cluster": "", + "comment": "Description", + "is_protected": "Protected", + "name": "Name", + "policy_name": "Name", + "protected_in_cloud": "Protected in Cloud", + "protected_in_ontap": "Protected in Ontap", + "schedule_name": "Transfer Schedule", + "scope": "Scope", + "svm": "", + "type": "Access Type", + "url": "", + "volume": "" + } } } ], "type": "table" - }, + } + ], + "title": "Bucket protection", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 45, + "panels": [ { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot count is < 10.", + "description": "Total number of volumes that are not protected.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [], + "mappings": [ + { + "options": { + "match": "null", + "result": { + "color": "rgb(21, 118, 171)", + "text": "0" + } + }, + "type": "special" + } + ], "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgb(31, 176, 196)", + "color": "dark-yellow", "value": null } ] @@ -1118,9 +1514,9 @@ "h": 5, "w": 6, "x": 0, - "y": 30 + "y": 12 }, - "id": 96, + "id": 79, "links": [], "options": { "colorMode": "value", @@ -1137,11 +1533,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy=~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}))) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1151,12 +1547,12 @@ "refId": "A" } ], - "title": " <10 Copies ", + "title": "Volumes not protected", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot count is between 10 to 100.", + "description": "Total number of volumes that are protected.", "fieldConfig": { "defaults": { "color": { @@ -1168,7 +1564,7 @@ "mode": "absolute", "steps": [ { - "color": "rgb(31, 176, 196)", + "color": "semi-dark-green", "value": null } ] @@ -1181,9 +1577,9 @@ "h": 5, "w": 6, "x": 6, - "y": 30 + "y": 12 }, - "id": 97, + "id": 75, "links": [], "options": { "colorMode": "value", @@ -1200,11 +1596,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1214,12 +1610,12 @@ "refId": "A" } ], - "title": "10-100 Copies", + "title": "Volumes protected", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot count is between 101 to 500.", + "description": "Total number of volumes whose snapshot size used is breached the snapshot reserve size.", "fieldConfig": { "defaults": { "color": { @@ -1231,7 +1627,7 @@ "mode": "absolute", "steps": [ { - "color": "rgb(31, 176, 196)", + "color": "light-red", "value": null } ] @@ -1244,9 +1640,9 @@ "h": 5, "w": 6, "x": 12, - "y": 30 + "y": 12 }, - "id": 98, + "id": 77, "links": [], "options": { "colorMode": "value", @@ -1263,11 +1659,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", + "expr": "count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1277,24 +1673,35 @@ "refId": "A" } ], - "title": "101-500 Copies", + "title": "Volumes breached", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of volumes whose snapshot count is > 500.", + "description": "Total number of volumes whose snapshot size used is not breached the snapshot reserve size.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [], + "mappings": [ + { + "options": { + "match": "null", + "result": { + "color": "rgb(21, 118, 171)", + "text": "0" + } + }, + "type": "special" + } + ], "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { - "color": "rgb(31, 176, 196)", + "color": "semi-dark-green", "value": null } ] @@ -1307,9 +1714,9 @@ "h": 5, "w": 6, "x": 18, - "y": 30 + "y": 12 }, - "id": 99, + "id": 81, "links": [], "options": { "colorMode": "value", @@ -1326,11 +1733,11 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", + "expr": "(count((volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})) * on (volume, svm, cluster) group_right() (volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} > 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} <= volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"})) OR on() vector(0)) + (count(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} == 0)) OR on() vector(0))", "format": "time_series", "hide": false, "instant": true, @@ -1340,12 +1747,12 @@ "refId": "A" } ], - "title": ">500 Copies", + "title": "Volumes not breached", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays volumes detail with snapshot count.", + "description": "This panel displays volumes detail with protected status and snapshot policy.", "fieldConfig": { "defaults": { "color": { @@ -1353,7 +1760,7 @@ "mode": "fixed" }, "custom": { - "align": "left", + "align": "auto", "displayMode": "auto", "filterable": true }, @@ -1372,68 +1779,146 @@ { "matcher": { "id": "byName", - "options": "Bucket" + "options": "Status" }, "properties": [ { "id": "custom.filterable", "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" }, { - "id": "mappings", + "id": "links", "value": [ { - "options": { - "from": 0, - "result": { - "index": 0, - "text": "< 10 Copies" - }, - "to": 9 - }, - "type": "range" - }, - { - "options": { - "from": 10, - "result": { - "index": 1, - "text": "10-100 Copies" - }, - "to": 100 - }, - "type": "range" - }, - { - "options": { - "from": 101, - "result": { - "index": 2, - "text": "101-500 Copies" - }, - "to": 500 - }, - "type": "range" - }, - { - "options": { - "from": 501, - "result": { - "index": 3, - "text": "> 500 Copies" - }, - "to": 1e+24 - }, - "type": "range" + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" } ] - }, + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ { "id": "displayName", - "value": "Snapshot Copies Bucket" + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] } ] + } + ] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 83, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": false, + "expr": "label_replace(label_replace(volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", volume!~\"MDV.*\"}, \"Status\", \"Protected\", \"snapshot_policy\", \"(.*)\") , \"Status\", \"Unprotected\", \"snapshot_policy\", \"(none.*)\") * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{})", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Volumes Protected With Snapshot Copies (local)", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "snapshot_policy", + "volume", + "Status", + "svm" + ] + } + } + }, + { + "id": "organize", + "options": { + "indexByName": { + "Status": 3, + "snapshot_policy": 2, + "svm": 1, + "volume": 0 + }, + "renameByName": { + "snapshot_policy": "Snapshot Policy" + } + } + } + ], + "type": "table" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "Volumes details of snapshot copy reserve space.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(31, 176, 196)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ { "matcher": { "id": "byName", @@ -1459,34 +1944,83 @@ { "matcher": { "id": "byName", - "options": "svm" + "options": "Value #B" }, "properties": [ { "id": "displayName", - "value": "SVM" + "value": "Used" }, { - "id": "links", + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #A" + }, + "properties": [ + { + "id": "displayName", + "value": "Reserved" + }, + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "mappings", "value": [ { - "targetBlank": true, - "title": "", - "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + "options": { + "from": -1e+25, + "result": { + "index": 0, + "text": "Not Breached" + }, + "to": 0 + }, + "type": "range" + }, + { + "options": { + "from": 0, + "result": { + "index": 1, + "text": "Breached" + }, + "to": 1e+25 + }, + "type": "range" } ] + }, + { + "id": "custom.filterable", + "value": true } ] }, { "matcher": { "id": "byName", - "options": "cluster" + "options": "svm" }, "properties": [ { "id": "displayName", - "value": "Cluster" + "value": "SVM" }, { "id": "links", @@ -1494,7 +2028,7 @@ { "targetBlank": true, "title": "", - "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" } ] } @@ -1503,12 +2037,14 @@ ] }, "gridPos": { - "h": 15, - "w": 24, - "x": 0, - "y": 35 + "h": 13, + "w": 12, + "x": 12, + "y": 17 }, - "id": 94, + "id": 91, + "interval": "1m", + "maxDataPoints": 2, "options": { "footer": { "fields": "", @@ -1520,83 +2056,107 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.4.11", + "pluginVersion": "8.1.8", "targets": [ { "exemplar": false, - "expr": "(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0)", + "expr": "volume_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", snapshot_policy!=\"\", snapshot_policy!~\"none.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{}) * on (volume, svm, cluster) group_right() ( volume_snapshot_reserve_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0 and volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"} >= 0)", "format": "table", + "hide": false, "instant": true, "interval": "", + "intervalFactor": 1, "legendFormat": "", "refId": "A" + }, + { + "exemplar": false, + "expr": "volume_snapshots_size_used{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" } ], - "title": "Volume count by the number of Snapshot copies", + "title": "Volumes Breaching Snapshot Copy Reserve Space", "transformations": [ + { + "id": "merge", + "options": {} + }, + { + "id": "filterByValue", + "options": { + "filters": [ + { + "config": { + "id": "greaterOrEqual", + "options": { + "value": 0 + } + }, + "fieldName": "Value #A" + } + ], + "match": "all", + "type": "include" + } + }, { "id": "filterFieldsByName", "options": { "include": { "names": [ - "svm", "volume", - "Value", - "cluster" + "Value #A", + "Value #B", + "svm" ] } } }, { - "id": "organize", + "id": "calculateField", "options": { - "excludeByName": {}, - "indexByName": { - "Value": 3, - "cluster": 2, - "svm": 1, - "volume": 0 + "alias": "Status", + "binary": { + "left": "Value #B", + "operator": "-", + "reducer": "sum", + "right": "Value #A" }, - "renameByName": { - "Value": "Snapshot Copies", - "volume": "" + "mode": "binary", + "reduce": { + "include": [ + "Value #A", + "Value #B" + ], + "reducer": "sum" } } }, { - "id": "calculateField", + "id": "organize", "options": { - "alias": "Bucket", - "mode": "reduceRow", - "reduce": { - "include": [ - "Snapshot Copies" - ], - "reducer": "last" - } + "excludeByName": {}, + "indexByName": { + "Status": 4, + "Value #A": 2, + "Value #B": 3, + "svm": 1, + "volume": 0 + }, + "renameByName": {} } } ], "type": "table" - } - ], - "title": "Snapshot Copies", - "type": "row" - }, - { - "collapsed": true, - "datasource": "${DS_PROMETHEUS}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 7 - }, - "id": 24, - "panels": [ + }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of total buckets.", + "description": "Total number of volumes whose snapshot count is < 10.", "fieldConfig": { "defaults": { "color": { @@ -1608,7 +2168,7 @@ "mode": "absolute", "steps": [ { - "color": "semi-dark-blue", + "color": "rgb(31, 176, 196)", "value": null } ] @@ -1619,11 +2179,11 @@ }, "gridPos": { "h": 5, - "w": 8, + "w": 6, "x": 0, - "y": 3 + "y": 30 }, - "id": 104, + "id": 96, "links": [], "options": { "colorMode": "value", @@ -1637,18 +2197,14 @@ "fields": "", "values": false }, - "showPercentChange": false, "text": {}, - "textMode": "auto", - "wideLayout": true + "textMode": "auto" }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.4.11", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} < 10)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1658,12 +2214,12 @@ "refId": "A" } ], - "title": "Total Buckets", + "title": " <10 Copies ", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of buckets which are not protected.", + "description": "Total number of volumes whose snapshot count is between 10 to 100.", "fieldConfig": { "defaults": { "color": { @@ -1675,7 +2231,7 @@ "mode": "absolute", "steps": [ { - "color": "red", + "color": "rgb(31, 176, 196)", "value": null } ] @@ -1686,11 +2242,11 @@ }, "gridPos": { "h": 5, - "w": 8, - "x": 8, - "y": 3 + "w": 6, + "x": 6, + "y": 30 }, - "id": 105, + "id": 97, "links": [], "options": { "colorMode": "value", @@ -1704,18 +2260,14 @@ "fields": "", "values": false }, - "showPercentChange": false, "text": {}, - "textMode": "auto", - "wideLayout": true + "textMode": "auto" }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.4.11", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",is_protected=\"false\"})", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} >= 10 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 100)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1725,12 +2277,12 @@ "refId": "A" } ], - "title": "Unprotected Buckets", + "title": "10-100 Copies", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "Number of buckets which are not backed up to cloud.", + "description": "Total number of volumes whose snapshot count is between 101 to 500.", "fieldConfig": { "defaults": { "color": { @@ -1742,7 +2294,7 @@ "mode": "absolute", "steps": [ { - "color": "red", + "color": "rgb(31, 176, 196)", "value": null } ] @@ -1753,11 +2305,11 @@ }, "gridPos": { "h": 5, - "w": 8, - "x": 16, - "y": 3 + "w": 6, + "x": 12, + "y": 30 }, - "id": 106, + "id": 98, "links": [], "options": { "colorMode": "value", @@ -1771,18 +2323,14 @@ "fields": "", "values": false }, - "showPercentChange": false, "text": {}, - "textMode": "auto", - "wideLayout": true + "textMode": "auto" }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.4.11", "targets": [ { - "datasource": "${DS_PROMETHEUS}", - "editorMode": "code", "exemplar": false, - "expr": "count(ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",protected_in_cloud=\"false\"})", + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 100 and volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} <= 500)) OR on() vector(0)", "format": "time_series", "hide": false, "instant": true, @@ -1792,12 +2340,75 @@ "refId": "A" } ], - "title": "Not Backed up to Cloud", + "title": "101-500 Copies", "type": "stat" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel displays bucket detail.", + "description": "Total number of volumes whose snapshot count is > 500.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(31, 176, 196)", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 30 + }, + "id": 99, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.4.11", + "targets": [ + { + "exemplar": false, + "expr": "count((volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 500)) OR on() vector(0)", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": ">500 Copies", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel displays volumes detail with snapshot count.", "fieldConfig": { "defaults": { "color": { @@ -1818,41 +2429,83 @@ "value": null } ] - }, - "unit": "bytes" + } }, "overrides": [ { "matcher": { "id": "byName", - "options": "cluster" + "options": "Bucket" }, "properties": [ { - "id": "displayName", - "value": "Cluster" + "id": "custom.filterable", + "value": true }, { - "id": "links", + "id": "mappings", "value": [ { - "targetBlank": true, - "title": "", - "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + "options": { + "from": 0, + "result": { + "index": 0, + "text": "< 10 Copies" + }, + "to": 9 + }, + "type": "range" + }, + { + "options": { + "from": 10, + "result": { + "index": 1, + "text": "10-100 Copies" + }, + "to": 100 + }, + "type": "range" + }, + { + "options": { + "from": 101, + "result": { + "index": 2, + "text": "101-500 Copies" + }, + "to": 500 + }, + "type": "range" + }, + { + "options": { + "from": 501, + "result": { + "index": 3, + "text": "> 500 Copies" + }, + "to": 1e+24 + }, + "type": "range" } ] + }, + { + "id": "displayName", + "value": "Snapshot Copies Bucket" } ] }, { "matcher": { "id": "byName", - "options": "datacenter" + "options": "volume" }, "properties": [ { "id": "displayName", - "value": "Datacenter" + "value": "Volume" }, { "id": "links", @@ -1860,7 +2513,7 @@ { "targetBlank": true, "title": "", - "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" } ] } @@ -1891,170 +2544,34 @@ { "matcher": { "id": "byName", - "options": "Access Type" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "options": { - "s3": { - "index": 0, - "text": "S3" - } - }, - "type": "value" - }, - { - "options": { - "match": "empty", - "result": { - "index": 2, - "text": "Not Supported" - } - }, - "type": "special" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Protected" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "options": { - "false": { - "color": "semi-dark-red", - "index": 1, - "text": "Not Protected" - }, - "true": { - "color": "semi-dark-green", - "index": 0, - "text": "Protected" - } - }, - "type": "value" - }, - { - "options": { - "match": "empty", - "result": { - "index": 2, - "text": "Not Supported" - } - }, - "type": "special" - } - ] - }, - { - "id": "custom.displayMode", - "value": "color-background-solid" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Protected in Cloud" + "options": "cluster" }, "properties": [ { - "id": "mappings", - "value": [ - { - "options": { - "false": { - "color": "semi-dark-red", - "index": 1, - "text": "Not Backed Up" - }, - "true": { - "color": "semi-dark-green", - "index": 0, - "text": "Backed Up" - } - }, - "type": "value" - }, - { - "options": { - "match": "empty", - "result": { - "index": 2, - "text": "Not Supported" - } - }, - "type": "special" - } - ] + "id": "displayName", + "value": "Cluster" }, { - "id": "custom.displayMode", - "value": "color-background-solid" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Protected in Ontap" - }, - "properties": [ - { - "id": "mappings", + "id": "links", "value": [ { - "options": { - "false": { - "color": "semi-dark-red", - "index": 1, - "text": "Not In Replication" - }, - "true": { - "color": "semi-dark-green", - "index": 0, - "text": "In Replication" - } - }, - "type": "value" - }, - { - "options": { - "match": "empty", - "result": { - "index": 2, - "text": "Not Supported" - } - }, - "type": "special" + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" } ] - }, - { - "id": "custom.displayMode", - "value": "color-background-solid" } ] } ] }, "gridPos": { - "h": 7, + "h": 15, "w": 24, "x": 0, - "y": 8 + "y": 35 }, - "id": 103, + "id": 94, "options": { "footer": { "fields": "", @@ -2066,106 +2583,67 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.1.8", + "pluginVersion": "8.4.11", "targets": [ { "exemplar": false, - "expr": "ontaps3_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", + "expr": "(volume_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",snapshot_policy!=\"\", snapshot_policy!~\"none.*\", volume!~\"MDV.*\"} * on (snapshot_policy) group_left () group by (snapshot_policy) (snapshot_policy_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"})) * on (volume,svm,cluster) (volume_snapshot_count{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"} > 0)", "format": "table", "instant": true, "interval": "", "legendFormat": "", "refId": "A" - }, - { - "exemplar": false, - "expr": "ontaps3_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", - "format": "table", - "hide": false, - "instant": true, - "interval": "", - "legendFormat": "", - "refId": "B" - }, - { - "exemplar": false, - "expr": "ontaps3_logical_used_size{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}", - "format": "table", - "hide": false, - "instant": true, - "interval": "", - "legendFormat": "", - "refId": "C" } ], - "title": "Buckets", + "title": "Volume count by the number of Snapshot copies", "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "names": [ - "bucket", - "cluster", - "datacenter", - "is_protected", - "protected_in_cloud", - "protected_in_ontap", "svm", - "Value #B", - "Value #C", - "type" + "volume", + "Value", + "cluster" ] } } }, - { - "id": "merge", - "options": {} - }, { "id": "organize", "options": { "excludeByName": {}, - "includeByName": {}, "indexByName": { - "Value #B": 4, - "Value #C": 5, - "bucket": 2, - "cluster": 1, - "datacenter": 0, - "is_protected": 7, - "protected_in_cloud": 8, - "protected_in_ontap": 9, - "svm": 3, - "type": 6 + "Value": 3, + "cluster": 2, + "svm": 1, + "volume": 0 }, "renameByName": { "Value": "Snapshot Copies", - "Value #B": "Size", - "Value #C": "Used", - "bucket": "Name", - "cluster": "", - "comment": "Description", - "is_protected": "Protected", - "name": "Name", - "policy_name": "Name", - "protected_in_cloud": "Protected in Cloud", - "protected_in_ontap": "Protected in Ontap", - "schedule_name": "Transfer Schedule", - "scope": "Scope", - "svm": "", - "type": "Access Type", - "url": "", "volume": "" } } + }, + { + "id": "calculateField", + "options": { + "alias": "Bucket", + "mode": "reduceRow", + "reduce": { + "include": [ + "Snapshot Copies" + ], + "reducer": "last" + } + } } ], "type": "table" } ], - "title": "Bucket protection", + "title": "Snapshot Copies", "type": "row" }, { @@ -2175,7 +2653,7 @@ "h": 1, "w": 24, "x": 0, - "y": 8 + "y": 20 }, "id": 23, "panels": [ From b39092310da7011a96bf2d4191c974f7d666bfdd Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 10 Jan 2025 17:27:29 +0530 Subject: [PATCH 17/19] feat: update ci --- cmd/tools/generate/counter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/tools/generate/counter.go b/cmd/tools/generate/counter.go index 8c786f2a5..f4f34d311 100644 --- a/cmd/tools/generate/counter.go +++ b/cmd/tools/generate/counter.go @@ -175,6 +175,7 @@ var ( "_labels", "volume_arw_status", "ALERTS", + "shelf_module_status", } // Exclude extra metrics for ZAPI @@ -184,6 +185,7 @@ var ( "security_", "svm_ldap", "ALERTS", + "shelf_module_status", } ) From ce3d133c86afcdee901d34ea8ebab1f9f1302b32 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 10 Jan 2025 20:48:20 +0530 Subject: [PATCH 18/19] feat: update ci and merge branch --- cmd/tools/generate/counter.go | 2 -- cmd/tools/generate/counter.yaml | 12 ++++++++++++ docs/ontap-metrics.md | 12 +++++++++++- integration/test/dashboard_json_test.go | 1 + integration/test/dashboard_test.go | 2 +- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/cmd/tools/generate/counter.go b/cmd/tools/generate/counter.go index f4f34d311..8c786f2a5 100644 --- a/cmd/tools/generate/counter.go +++ b/cmd/tools/generate/counter.go @@ -175,7 +175,6 @@ var ( "_labels", "volume_arw_status", "ALERTS", - "shelf_module_status", } // Exclude extra metrics for ZAPI @@ -185,7 +184,6 @@ var ( "security_", "svm_ldap", "ALERTS", - "shelf_module_status", } ) diff --git a/cmd/tools/generate/counter.yaml b/cmd/tools/generate/counter.yaml index e69c60326..6265bcd24 100644 --- a/cmd/tools/generate/counter.yaml +++ b/cmd/tools/generate/counter.yaml @@ -2058,3 +2058,15 @@ counters: Endpoint: NA ONTAPCounter: Harvest generated Template: conf/rest/9.6.0/clustersoftware.yaml + + - Name: shelf_module_status + Description: Displays the shelf module labels with their status. + APIs: + - API: REST + Endpoint: NA + ONTAPCounter: Harvest generated + Template: conf/restperf/9.12.0/disk.yaml + - API: ZAPI + Endpoint: NA + ONTAPCounter: Harvest generated + Template: conf/zapiperf/cdot/9.8.0/disk.yaml \ No newline at end of file diff --git a/docs/ontap-metrics.md b/docs/ontap-metrics.md index 755941bdc..5592fd322 100644 --- a/docs/ontap-metrics.md +++ b/docs/ontap-metrics.md @@ -7,7 +7,7 @@ These can be generated on demand by running `bin/harvest grafana metrics`. See - More information about ONTAP REST performance counters can be found [here](https://docs.netapp.com/us-en/ontap-pcmap-9121/index.html). ``` -Creation Date : 2024-Dec-02 +Creation Date : 2025-Jan-10 ONTAP Version: 9.16.1 ``` ## Understanding the structure @@ -11023,6 +11023,16 @@ Minimum temperature of all non-ambient sensors for shelf in Celsius. | ZAPI | `NA` | `Harvest generated`
Unit:
Type:
Base: | conf/zapiperf/cdot/9.8.0/disk.yaml | +### shelf_module_status + +Displays the shelf module labels with their status. + +| API | Endpoint | Metric | Template | +|--------|----------|--------|---------| +| REST | `NA` | `Harvest generated`
Unit:
Type:
Base: | conf/restperf/9.12.0/disk.yaml | +| ZAPI | `NA` | `Harvest generated`
Unit:
Type:
Base: | conf/zapiperf/cdot/9.8.0/disk.yaml | + + ### shelf_new_status This metric indicates a value of 1 if the shelf state is online or ok (indicating the shelf is operational) and a value of 0 for any other state (indicating the shelf is not operational). diff --git a/integration/test/dashboard_json_test.go b/integration/test/dashboard_json_test.go index 0f9c6222d..08ffceb4a 100644 --- a/integration/test/dashboard_json_test.go +++ b/integration/test/dashboard_json_test.go @@ -50,6 +50,7 @@ var zapiCounterMap = map[string]struct{}{ "aggr_object_store_logical_used": {}, "aggr_object_store_physical_used": {}, "fru_status": {}, + "snapshot_policy_labels": {}, } // restCounterMap are additional counters, above and beyond the ones from counterMap, which should be excluded from Rest diff --git a/integration/test/dashboard_test.go b/integration/test/dashboard_test.go index bb3deec5d..cd62684e6 100644 --- a/integration/test/dashboard_test.go +++ b/integration/test/dashboard_test.go @@ -79,7 +79,7 @@ func TestCModeDashboardCount(t *testing.T) { "ONTAP: SVM", "ONTAP: Volume", "ONTAP: MetroCluster", - "ONTAP: Data Protection Snapshots", + "ONTAP: Data Protection", "ONTAP: Qtree", "ONTAP: Security", "ONTAP: Power", From 12f8cbaf6955ff09155eac38ce2952616c848fb7 Mon Sep 17 00:00:00 2001 From: hardikl Date: Mon, 13 Jan 2025 12:49:04 +0530 Subject: [PATCH 19/19] feat: update ci --- integration/test/dashboard_json_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration/test/dashboard_json_test.go b/integration/test/dashboard_json_test.go index 08ffceb4a..847a1ee7d 100644 --- a/integration/test/dashboard_json_test.go +++ b/integration/test/dashboard_json_test.go @@ -51,6 +51,7 @@ var zapiCounterMap = map[string]struct{}{ "aggr_object_store_physical_used": {}, "fru_status": {}, "snapshot_policy_labels": {}, + "cluster_schedule_labels": {}, } // restCounterMap are additional counters, above and beyond the ones from counterMap, which should be excluded from Rest