Skip to content

feat: add node handling for cm2 - #4390

Merged
rahulguptajss merged 3 commits into
mainfrom
rg2-cm2-node
Aug 7, 2026
Merged

feat: add node handling for cm2#4390
rahulguptajss merged 3 commits into
mainfrom
rg2-cm2-node

Conversation

@rahulguptajss

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 7, 2026 06:38
@cla-bot cla-bot Bot added the cla-signed label Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CM2 (cmperf) collector and its ONTAP 9.19.1 cmperf templates so node-scoped data can be labeled/identified correctly (by exposing node_name from the CM2 batch’s ObjectCollection.Node and by converting string identity fields into template keys/labels).

Changes:

  • Add node_name injection in populateMatrix using ObjectCollection.Node.
  • Update multiple conf/cmperf/9.19.1/*.yaml templates to mark string identity fields as keys/labels using ^^/^ (including node-related fields) and reorder/remove duplicates accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
conf/cmperf/9.19.1/volume_node.yaml Marks node identity field as a key to support node-level volume metrics labeling.
conf/cmperf/9.19.1/token_manager.yaml Promotes identity fields to labels/keys so node/token dimensions can be exported.
conf/cmperf/9.19.1/qtree.yaml Converts qtree identity fields to ^^/^ key/label entries for proper labeling.
conf/cmperf/9.19.1/ontap_s3_svm.yaml Adds key/label identity fields (incl. node) so ontaps3 SVM metrics can be attributed correctly.
conf/cmperf/9.19.1/object_store_client_op.yaml Promotes identity fields (incl. node) to labels/keys for FabricPool client-op metrics.
conf/cmperf/9.19.1/nvmf_tcp_port.yaml Adds key/label identity fields (incl. node/svm/port) for NVMf TCP port metrics.
conf/cmperf/9.19.1/nvmf_rdma_port.yaml Adds key/label identity fields (incl. node/svm/port) for NVMf RDMA port metrics.
conf/cmperf/9.19.1/nfsv4_pool.yaml Promotes instance/node identity fields to key/label entries for NFSv4 pool metrics.
conf/cmperf/9.19.1/netstat.yaml Promotes connection identity fields (incl. node) to key/label entries for netstat metrics.
conf/cmperf/9.19.1/fcvi.yaml Promotes instance/node identity fields to key/label entries for FCVI metrics.
conf/cmperf/9.19.1/fcp.yaml Promotes port/node identity fields to key/label entries for FCP port metrics.
conf/cmperf/9.19.1/external_service_operation.yaml Promotes operation/service identity fields (incl. node/svm) to key/label entries.
conf/cmperf/9.19.1/disk.yaml Promotes disk identity fields (incl. node/disk UUID) to key/label entries.
conf/cmperf/9.19.1/cifs_vserver.yaml Promotes SVM CIFS identity fields to key/label entries.
conf/cmperf/9.19.1/cifs_node.yaml Marks node identity field as a key to support node-level CIFS metrics labeling.
cmd/collectors/cmperf/cm2.go Adds node_name population from CM2 batch node to support templates that label by node.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread conf/cmperf/9.19.1/token_manager.yaml Outdated
Comment thread conf/cmperf/9.19.1/object_store_client_op.yaml Outdated
Comment thread cmd/collectors/cmperf/cm2.go
Copilot AI review requested due to automatic review settings August 7, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Suppressed comments (2)

cmd/collectors/cmperf/cm2.go:425

  • The new CM2 node handling (propagating ObjectCollection.Node into the instance label set) is not covered by unit tests. Adding a small test that constructs an ObjectCollection with Node set and verifies populateMatrix sets the exported node label (and/or affects instance key when node_name is a key) would prevent regressions.
		if oc.Node != "" {
			stringVals["node_name"] = oc.Node
		}

cmd/collectors/cmperf/cm2.go:425

  • Setting stringVals["node_name"] before iterating inst.Counters can be overwritten by a node_name string counter later in the loop (including overwriting with an empty string). That can cause missing/empty node labels and even empty instance keys when node_name is part of InstanceKeys. Prefer filling node_name from oc.Node after processing counters, and only when node_name is still empty.
		if oc.Node != "" {
			stringVals["node_name"] = oc.Node
		}

cgrinds
cgrinds previously approved these changes Aug 7, 2026
Copilot AI review requested due to automatic review settings August 7, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Suppressed comments (2)

cmd/collectors/cmperf/cm2.go:425

  • The new oc.Nodenode_name label fallback isn’t covered by unit tests. Adding a small test that exercises populateMatrix with (a) no node_name counter and (b) an empty node_name counter would help prevent regressions in label/key construction.
		if oc.Node != "" {
			stringVals["node_name"] = oc.Node
		}

cmd/collectors/cmperf/cm2.go:427

  • node_name is set from oc.Node before reading string counters, but the subsequent counter loop can overwrite it with an empty node_name counter value. That can drop the node label even though the collection header has a valid node name. Prefer using oc.Node as a fallback only when the instance doesn’t already have a non-empty node_name.
		if oc.Node != "" {
			stringVals["node_name"] = oc.Node
		}

		for _, ct := range inst.Counters {

@rahulguptajss
rahulguptajss merged commit f4b236e into main Aug 7, 2026
14 checks passed
@rahulguptajss
rahulguptajss deleted the rg2-cm2-node branch August 7, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants