Skip to content

Commit

Permalink
feat: Description fetched from ontap docs via cli - all
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardikl committed Nov 2, 2023
1 parent d389e89 commit bf225dd
Show file tree
Hide file tree
Showing 29 changed files with 463 additions and 334 deletions.
20 changes: 1 addition & 19 deletions cmd/tools/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func doDescription(cmd *cobra.Command, _ []string) {
addRootOptions(cmd)
counters := generateMetricsWithDoc(false)
grafana.VisitDashboards(
[]string{"grafana/dashboards/cmode/volume.json"},
[]string{"grafana/dashboards/cmode"},
func(path string, data []byte) {
checkDesc(path, data, counters)
})
Expand Down Expand Up @@ -555,31 +555,13 @@ func checkDesc(dPath string, data []byte, counters map[string]Counter) {
return
}

// we don't get description for below panels, we need to manually formed them as per our need.
ignoreList := []string{
// These are from fsa
"Volume Access ($Activity) History", "Volume Access ($Activity) History By Percent", "Volume Modify ($Activity) History", "Volume Modify ($Activity) History By Percent",
// These are from snapmirror
"Destination Relationships per Node", "Source Relationships per SVM", "Destination Relationships per SVM",
// This is from workload
"Service Latency by Resources",
// These are from svm
"NFSv3 Latency Heatmap", "NFSv3 Read Latency Heatmap", "NFSv3 Write Latency Heatmap",
"NFSv4 Latency Heatmap", "NFSv4 Read Latency Heatmap", "NFSv4 Write Latency Heatmap",
"NFSv4.1 Latency Heatmap", "NFSv4.1 Read Latency Heatmap", "NFSv4.1 Write Latency Heatmap",
}

grafana.VisitAllPanels(data, func(path string, key, value gjson.Result) {
kind := value.Get("type").String()
if kind == "row" || kind == "text" {
return
}
description := value.Get("description").String()
targetsSlice := value.Get("targets").Array()
title := value.Get("title").String()
if slices.Contains(ignoreList, title) {
return
}

if description == "" {
if len(targetsSlice) == 1 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/grafana/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ func checkRowNames(t *testing.T, path string, data []byte) {
func TestDescription(t *testing.T) {
count := 0
VisitDashboards(
[]string{"../../../grafana/dashboards/cmode/volume.json"},
[]string{"../../../grafana/dashboards/cmode"},
func(path string, data []byte) {
checkDescription(t, path, data, &count)
})
Expand Down
56 changes: 30 additions & 26 deletions grafana/dashboards/cmode/aggregate.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
{
"cacheTimeout": null,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of aggregates.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -176,7 +176,7 @@
{
"cacheTimeout": null,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of disks in the aggregate.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -252,7 +252,7 @@
{
"cacheTimeout": null,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of flexvol volumes in the aggregate.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -327,7 +327,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Total usable space in bytes, not including WAFL reserve and aggregate Snapshot copy reserve.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -385,7 +385,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Space available in bytes.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -977,7 +977,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Total physical used size of an aggregate in bytes.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1068,7 +1068,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Space available in bytes.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1159,7 +1159,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Used space in bytes in the cloud store. Only applicable for aggregates with a cloud store tier.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1250,7 +1250,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Space saved in bytes by compacting the data.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1341,7 +1341,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Amount of space saved in bytes by storage efficiency.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1530,7 +1530,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "The percentage of disk space currently in use based on user-visible file count on the referenced file system.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1911,7 +1911,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Percentage of disk space used by Snapshot copies.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2002,7 +2002,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Percentage of space reserved for Snapshot copies.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2093,7 +2093,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "The percentage of disk space currently in use based on user-visible file (inode) count on the referenced file system.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2562,7 +2562,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Logical used.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2647,6 +2647,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Total Physical Used.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2731,6 +2732,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Logical used.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2815,6 +2817,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Total Data Reduction Physical Used Without Snapshots.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2899,7 +2902,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Logical used.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -2984,6 +2987,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Total data deduction physical used without snapshots and Flexclones.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -3083,7 +3087,7 @@
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"description": "Disk Utilization per Aggregate for latest record (independent of time range selected)",
"description": "Disk Utilization per Aggregate for latest record (independent of time range selected).",
"fieldConfig": {
"defaults": {
"custom": {
Expand Down Expand Up @@ -3243,7 +3247,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Disk Utilization per Aggregate in the selected time range",
"description": "Disk Utilization per Aggregate in the selected time range.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -3929,7 +3933,7 @@
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "A summation of volume footprints (including volume guarantees), in bytes. This includes all of the volume footprints in the block_storage tier and the cloud_storage tier.This is an advanced property; there is an added computational cost to retrieving its value. The field is not populated for either a collection GET or an instance GET unless it is explicitly requested using the <i>fields</i> query parameter containing either footprint or **.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4023,7 +4027,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Volume footprints percent.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4118,7 +4122,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Used space in bytes in the cloud store. Only applicable for aggregates with a cloud store tier.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4506,7 +4510,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Flexgroup by-aggregate filtering does not display the per-aggregate breakdown, instead the sum of all flexgroup aggregates is displayed. This is how ONTAP reports the data, even when an aggregate is selected in the dropdown.\n\nNote that in some scenarios, it is possible to exceed 100% of the space allocated.\n",
"description": "Flexgroup by-aggregate filtering does not display the per-aggregate breakdown, instead the sum of all flexgroup aggregates is displayed. This is how ONTAP reports the data, even when an aggregate is selected in the dropdown.\n\nNote that in some scenarios, it is possible to exceed 100% of the space allocated.\n.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4601,7 +4605,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Footprint of blocks written to the volume in bytes for the performance tier (bin 0).",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4695,7 +4699,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Footprint of blocks written to the volume in performance tier (bin 0) as a percentage of aggregate size.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4790,7 +4794,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Footprint of blocks written to the volume in bytes for capacity tier (bin 1).",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -4884,7 +4888,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Footprint of blocks written to the volume in capacity tier (bin 1) as a percentage of aggregate size.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down
13 changes: 8 additions & 5 deletions grafana/dashboards/cmode/cdot.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of CIFS operations per second.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -180,7 +180,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of NFS operations per second.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -270,7 +270,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of operations per second serviced by the volume.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -548,6 +548,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Average latency in microseconds for the WAFL filesystem to process all the operations on the volume; not including request processing or network communication time. node_volume_avg_latency is [volume_avg_latency](#volume_avg_latency) aggregated by `node`.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1333,6 +1334,7 @@
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"description": "Average latency in microseconds for the WAFL filesystem to process all the operations on the volume; not including request processing or network communication time.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1509,6 +1511,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Number of operations per second serviced by the volume.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1612,7 +1615,7 @@
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Average latency in microseconds for the WAFL filesystem to process all the operations on the volume; not including request processing or network communication time.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1794,7 +1797,7 @@
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"description": "Number of operations per second serviced by the volume.",
"fieldConfig": {
"defaults": {
"color": {
Expand Down
Loading

0 comments on commit bf225dd

Please sign in to comment.