Skip to content

Commit

Permalink
fix: handled cloud_target for fabricpool
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardikl authored and cgrinds committed Nov 8, 2023
1 parent b1d0383 commit d3acca2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/collectors/fabricpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func GetFlexGroupFabricPoolMetrics(dataMap map[string]*matrix.Matrix, object str
continue
}
if match := re.FindStringSubmatch(i.GetLabel("volume")); len(match) == 3 {
key := i.GetLabel("svm") + "." + match[1]
key := i.GetLabel("svm") + "." + match[1] + i.GetLabel("cloud_target")
if cache.GetInstance(key) == nil {
fg, _ := cache.NewInstance(key)
fg.SetLabels(maps.Clone(i.GetLabels()))
Expand All @@ -50,8 +50,8 @@ func GetFlexGroupFabricPoolMetrics(dataMap map[string]*matrix.Matrix, object str
// create summary
for _, i := range data.GetInstances() {
if match := re.FindStringSubmatch(i.GetLabel("volume")); len(match) == 3 {
// instance key is svm.flexgroup-volume
key := i.GetLabel("svm") + "." + match[1]
// instance key is svm.flexgroup-volume.cloud-target-name
key := i.GetLabel("svm") + "." + match[1] + i.GetLabel("cloud_target")

fg := cache.GetInstance(key)
if fg == nil {
Expand Down
8 changes: 4 additions & 4 deletions grafana/dashboards/cmode/volume.json
Original file line number Diff line number Diff line change
Expand Up @@ -4997,7 +4997,7 @@
"expr": "topk($TopResources, fabricpool_cloud_bin_op_latency_average{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$TopCloudBinOpGetLatency\", metric=\"GET\"})",
"hide": false,
"interval": "",
"legendFormat": "{{svm}} - {{volume}}",
"legendFormat": "{{svm}} - {{volume}} - {{cloud_target}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -5090,7 +5090,7 @@
"expr": "topk($TopResources, fabricpool_cloud_bin_operation{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$TopCloudBinOperationGet\", metric=\"GET\"})",
"hide": false,
"interval": "",
"legendFormat": "{{svm}} - {{volume}}",
"legendFormat": "{{svm}} - {{volume}} - {{cloud_target}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -5183,7 +5183,7 @@
"expr": "topk($TopResources, fabricpool_cloud_bin_op_latency_average{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$TopCloudBinOpPutLatency\", metric=\"PUT\"})",
"hide": false,
"interval": "",
"legendFormat": "{{svm}} - {{volume}}",
"legendFormat": "{{svm}} - {{volume}} - {{cloud_target}}",
"refId": "A"
}
],
Expand Down Expand Up @@ -5276,7 +5276,7 @@
"expr": "topk($TopResources, fabricpool_cloud_bin_operation{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$TopCloudBinOperationPut\", metric=\"PUT\"})",
"hide": false,
"interval": "",
"legendFormat": "{{svm}} - {{volume}} ",
"legendFormat": "{{svm}} - {{volume}} - {{cloud_target}}",
"refId": "A"
}
],
Expand Down

0 comments on commit d3acca2

Please sign in to comment.