Skip to content

Commit

Permalink
feat: merge main and disable changelog by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Aug 30, 2023
1 parent b798c1b commit 1731afd
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
13 changes: 7 additions & 6 deletions cmd/poller/plugin/changelog/change_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c *ChangeLog) Init() error {
}

// Initialize the changeLogMap
c.changeLogMap = make(map[string]*matrix.Matrix, 0)
c.changeLogMap = make(map[string]*matrix.Matrix)

object := c.ParentParams.GetChildS("object")
c.matrixName = object.GetContentS() + "_" + changeLog
Expand Down Expand Up @@ -143,7 +143,7 @@ func (c *ChangeLog) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, er

prevMat := c.previousData
oldInstances := set.New()
prevInstancesUUIDKey := make(map[string]string, 0)
prevInstancesUUIDKey := make(map[string]string)
for key, prevInstance := range prevMat.GetInstances() {
uuid := prevInstance.GetLabel("uuid")
if uuid == "" {
Expand Down Expand Up @@ -180,7 +180,7 @@ func (c *ChangeLog) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, er
key: uuid + "_" + object,
object: object,
op: create,
labels: make(map[string]string, 0),
labels: make(map[string]string),
time: currentTime,
}
c.updateChangeLogLabels(object, instance, change)
Expand All @@ -194,7 +194,7 @@ func (c *ChangeLog) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, er
key: uuid + "_" + object + "_" + currentLabel,
object: object,
op: update,
labels: make(map[string]string, 0),
labels: make(map[string]string),
track: currentLabel,
oldValue: old.Get(currentLabel),
newValue: newLabel,
Expand Down Expand Up @@ -223,7 +223,7 @@ func (c *ChangeLog) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, er
key: uuid + "_" + object,
object: object,
op: del,
labels: make(map[string]string, 0),
labels: make(map[string]string),
time: currentTime,
}
c.updateChangeLogLabels(object, prevInstance, change)
Expand Down Expand Up @@ -255,7 +255,8 @@ func (c *ChangeLog) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, er

// copyPreviousData creates a copy of the previous data for comparison
func (c *ChangeLog) copyPreviousData(cur *matrix.Matrix) {
labels := append(c.changeLogConfig.PublishLabels, c.changeLogConfig.Track...)
labels := c.changeLogConfig.PublishLabels
labels = append(labels, c.changeLogConfig.Track...)
labels = append(labels, "uuid")
c.previousData = cur.Clone(matrix.With{Data: true, Metrics: false, Instances: true, ExportInstances: false, Labels: labels})
}
Expand Down
2 changes: 1 addition & 1 deletion conf/rest/9.10.0/svm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ plugins:
- new_status state online online `0`
- ldap_signed ldap_session_security sign sign `0`
- ldap_encrypted ldap_session_security seal seal `0`
- ChangeLog
# - ChangeLog

export_options:
instance_keys:
Expand Down
1 change: 1 addition & 0 deletions conf/rest/9.10.0/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ plugins:
# - volume `MDV_CRS_.+`
# # Exclude Metadata volumes, Audit volumes have a “MDV_aud_” prefix
# - volume `MDV_aud_.+`
# - ChangeLog

export_options:
instance_keys:
Expand Down
1 change: 1 addition & 0 deletions conf/rest/9.9.0/svm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ plugins:
- new_status state online online `0`
- ldap_signed ldap_session_security sign sign `0`
- ldap_encrypted ldap_session_security seal seal `0`
# - ChangeLog

export_options:
instance_keys:
Expand Down
2 changes: 1 addition & 1 deletion conf/rest/9.9.0/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ plugins:
# - volume `MDV_CRS_.+`
# # Exclude Metadata volumes, Audit volumes have a “MDV_aud_” prefix
# - volume `MDV_aud_.+`
- ChangeLog
# - ChangeLog

export_options:
instance_keys:
Expand Down
2 changes: 1 addition & 1 deletion conf/zapi/cdot/9.8.0/shelf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object: shelf

counters:
storage-shelf-info:
- ^^shelf-uid
- ^^shelf-uid => uuid
- ^module-type => module_type
- ^op-status => op_status
- ^serial-number => serial_number
Expand Down
2 changes: 1 addition & 1 deletion conf/zapi/cdot/9.8.0/svm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins:
- new_status state online online `0`
- ldap_signed ldap_session_security sign sign `0`
- ldap_encrypted ldap_session_security seal seal `0`
- ChangeLog
# - ChangeLog

export_options:
instance_keys:
Expand Down
2 changes: 1 addition & 1 deletion conf/zapi/cdot/9.8.0/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ plugins:
- svm_root root_volume `false` `No`
- node_root root_volume `true` `Yes`
- svm_root root_volume `true` `Yes`
- ChangeLog
# - ChangeLog

export_options:
instance_keys:
Expand Down
2 changes: 1 addition & 1 deletion grafana/dashboards/cmode/changelogMonitor.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
]
},
"description": "The ONTAP Changelog Monitor is a comprehensive dashboard that provides tracking of configuration changes for ONTAP objects such as volumes, SVMs, and nodes.",
"description": "The ONTAP Changelog Monitor, tracks configuration modifications in volumes, SVMs, and nodes, is deactivated by default. To leverage this feature, one must enable the ChangeLog plugin within the Volume, SVM, and Node Templates.",
"editable": true,
"gnetId": null,
"graphTooltip": 1,
Expand Down

0 comments on commit 1731afd

Please sign in to comment.