Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding snapmirror history rest/zapi templates #3482

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion cmd/tools/generate/counter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2022,4 +2022,37 @@ counters:
- API: ZAPI
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/zapiperf/cdot/9.8.0/disk.yaml
Template: conf/zapiperf/cdot/9.8.0/disk.yaml

- Name: snapmirror_history_start_time
Description: Displays the time at which the snapmirror data transfer job started.

- Name: snapmirror_history_end_time
Description: Displays the time at which the snapmirror data transfer job ended.

- Name: snapmirror_history_transfer_size
Description: Displays the amount of data (in bytes) being transferred from source to destination in the snapmirror job.

- Name: snapmirror_history_duration
Description: Displays the duration of the snapmirror data transfer job.
APIs:
- API: REST
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/rest/9.6.0/snapmirrorhistory.yaml
- API: ZAPI
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml

- Name: snapmirror_history_bandwidth
Description: Displays the bandwidth of the snapmirror data transfer job.
APIs:
- API: REST
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/rest/9.6.0/snapmirrorhistory.yaml
- API: ZAPI
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml
43 changes: 43 additions & 0 deletions conf/rest/9.6.0/snapmirrorhistory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SnapMirrorHistory
query: api/private/cli/snapmirror/show-history
object: snapmirror_history

counters:
- ^^operation_id
- ^destination_path => destination_location
- ^destination_volume
- ^destination_vserver
- ^operation_type
- ^relationship_group_type => group_type
- ^relationship_id => relationship_id
- ^result => result
- ^source_path => source_location
- ^source_volume
- ^source_vserver
- end_time(timestamp) => end_time
- start_time(timestamp) => start_time
- transfer_size

# - filter:
# - expand=true

plugins:
- MetricAgent:
compute_metric:
- duration SUBTRACT end_time start_time
- bandwidth DIVIDE transfer_size duration

export_options:
instance_keys:
- destination_location
- destination_volume
- destination_vserver
- operation_id
- relationship_id
- source_volume
- source_vserver
instance_labels:
- group_type
- operation_type
- result

1 change: 1 addition & 0 deletions conf/rest/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ objects:
Sensor: sensor.yaml
Shelf: shelf.yaml
SnapMirror: snapmirror.yaml
SnapMirrorHistory: snapmirrorhistory.yaml
SnapMirrorPolicy: snapmirrorpolicy.yaml
SnapshotPolicy: snapshotpolicy.yaml
Status: status.yaml
Expand Down
39 changes: 39 additions & 0 deletions conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: SnapMirrorHistory
query: snapmirror-history-get-iter
object: snapmirror_history
counters:
snapmirror-history-info:
- ^^operation-id
- ^destination-location
- ^destination-volume
- ^destination-vserver
- ^operation-type
- ^relationship-group-type => group_type
- ^relationship-id
- ^result => result
- ^source-location
- ^source-volume
- ^source-vserver
- end-time
- start-time
- transfer-size

plugins:
- MetricAgent:
compute_metric:
- duration SUBTRACT end_time start_time
- bandwidth DIVIDE transfer_size duration

export_options:
instance_keys:
- destination_location
- destination_volume
- destination_vserver
- operation_id
- relationship_id
- source_volume
- source_vserver
instance_labels:
- group_type
- operation_type
- result
1 change: 1 addition & 0 deletions conf/zapi/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ objects:
Sensor: sensor.yaml
Shelf: shelf.yaml
SnapMirror: snapmirror.yaml
SnapMirrorHistory: snapmirrorhistory.yaml
SnapshotPolicy: snapshotpolicy.yaml
Status: status.yaml
Status_7mode: status_7.yaml
Expand Down
52 changes: 51 additions & 1 deletion docs/ontap-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 : 2025-Feb-12
Creation Date : 2025-Feb-18
ONTAP Version: 9.16.1
```
## Understanding the structure
Expand Down Expand Up @@ -11370,6 +11370,56 @@ The number of successful SnapMirror break operations for the relationship
| ZAPI | `snapmirror-get-iter` | `snapmirror-info.break-successful-count` | conf/zapi/cdot/9.8.0/snapmirror.yaml |


### snapmirror_history_bandwidth

Displays the bandwidth of the snapmirror data transfer job.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `NA` | `Harvest generated` | conf/rest/9.6.0/snapmirrorhistory.yaml |
| ZAPI | `NA` | `Harvest generated` | conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml |


### snapmirror_history_duration

Displays the duration of the snapmirror data transfer job.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `NA` | `Harvest generated` | conf/rest/9.6.0/snapmirrorhistory.yaml |
| ZAPI | `NA` | `Harvest generated` | conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml |


### snapmirror_history_end_time

Displays the time at which the snapmirror data transfer job ended.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/snapmirror/show-history` | `end_time` | conf/rest/9.6.0/snapmirrorhistory.yaml |
| ZAPI | `snapmirror-history-get-iter` | `snapmirror-history-info.end-time` | conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml |


### snapmirror_history_start_time

Displays the time at which the snapmirror data transfer job started.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/snapmirror/show-history` | `start_time` | conf/rest/9.6.0/snapmirrorhistory.yaml |
| ZAPI | `snapmirror-history-get-iter` | `snapmirror-history-info.start-time` | conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml |


### snapmirror_history_transfer_size

Displays the amount of data (in bytes) being transferred from source to destination in the snapmirror job.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/snapmirror/show-history` | `transfer_size` | conf/rest/9.6.0/snapmirrorhistory.yaml |
| ZAPI | `snapmirror-history-get-iter` | `snapmirror-history-info.transfer-size` | conf/zapi/cdot/9.8.0/snapmirrorhistory.yaml |


### snapmirror_lag_time

Amount of time since the last snapmirror transfer in seconds
Expand Down
Loading