Skip to content

Commit

Permalink
fix: handle endpoints in metric doc (#3011)
Browse files Browse the repository at this point in the history
* fix: handle endpoints in metric doc

* fix: handle endpoints in metric doc
  • Loading branch information
rahulguptajss committed Jun 25, 2024
1 parent 43caf91 commit 9221f35
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 43 deletions.
61 changes: 39 additions & 22 deletions cmd/tools/generate/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,46 @@ func processRestConfigCounters(path string) map[string]Counter {
return nil
}

if templateCounters == nil {
return nil
if templateCounters != nil {
processCounters(templateCounters.GetAllChildContentS(), &model, path, model.Query, counters)
}

for _, c := range templateCounters.GetAllChildContentS() {
endpoints := t.GetChildS("endpoints")
if endpoints != nil {
for _, endpoint := range endpoints.GetChildren() {
var query string
for _, line := range endpoint.GetChildren() {
if line.GetNameS() == "query" {
query = line.GetContentS()
}
if line.GetNameS() == "counters" {
processCounters(line.GetAllChildContentS(), &model, path, query, counters)
}
}
}
}

// If the template has any PluginMetrics, add them
for _, metric := range model.PluginMetrics {
co := Counter{
Name: model.Object + "_" + metric.Name,
APIs: []MetricDef{
{
API: "REST",
Endpoint: model.Query,
Template: path,
ONTAPCounter: metric.Source,
},
},
}
counters[co.Name] = co
}

return counters
}

func processCounters(counterContents []string, model *template2.Model, path, query string, counters map[string]Counter) {
for _, c := range counterContents {
if c == "" {
continue
}
Expand All @@ -298,7 +333,7 @@ func processRestConfigCounters(path string) map[string]Counter {
APIs: []MetricDef{
{
API: "REST",
Endpoint: model.Query,
Endpoint: query,
Template: path,
ONTAPCounter: name,
},
Expand All @@ -314,24 +349,6 @@ func processRestConfigCounters(path string) map[string]Counter {
}
}
}

// If the template has any PluginMetrics, add them
for _, metric := range model.PluginMetrics {
co := Counter{
Name: model.Object + "_" + metric.Name,
APIs: []MetricDef{
{
API: "REST",
Endpoint: model.Query,
Template: path,
ONTAPCounter: metric.Source,
},
},
}
counters[co.Name] = co
}

return counters
}

// processZAPIPerfCounters process ZapiPerf counters
Expand Down
30 changes: 14 additions & 16 deletions cmd/tools/generate/counter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,12 @@ counters:

- Name: disk_stats_io_kbps
Description: Total Disk Throughput in KBPS Across All Active Paths
APIs:
- API: REST
Endpoint: api/private/cli/disk
ONTAPCounter: disk_io_kbps_total
Template: conf/rest/9.12.0/disk.yaml

- Name: disk_stats_sectors_read
Description: Number of Sectors Read
APIs:
- API: REST
Endpoint: api/private/cli/disk
ONTAPCounter: sectors_read
Template: conf/rest/9.12.0/disk.yaml

- Name: disk_stats_sectors_written
Description: Number of Sectors Written
APIs:
- API: REST
Endpoint: api/private/cli/disk
ONTAPCounter: sectors_written
Template: conf/rest/9.12.0/disk.yaml

- Name: disk_uptime
Description: Number of seconds the drive has been powered on
Expand Down Expand Up @@ -1078,4 +1063,17 @@ counters:
- API: REST
Endpoint: NA
ONTAPCounter: Harvest generated
Template: conf/rest/9.12.0/qtree.yaml
Template: conf/rest/9.12.0/qtree.yaml

- Name: volume_space_performance_tier_inactive_user_data
Description: The size that is physically used in the performance tier of the volume and has a cold temperature. This parameter is only supported if the volume is in an aggregate that is either attached to object store or could be attached to an object store.

- Name: volume_space_performance_tier_inactive_user_data_percent
Description: The size (in percent) that is physically used in the performance tier of the volume and has a cold temperature. This parameter is only supported if the volume is in an aggregate that is either attached to object store or could be attached to an object store.

- Name: aggr_object_store_logical_used
Description: Logical space usage of aggregates in the attached object store.

- Name: aggr_object_store_physical_used
Description: Physical space usage of aggregates in the attached object store.

111 changes: 106 additions & 5 deletions 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 : 2024-Jun-03
Creation Date : 2024-Jun-24
ONTAP Version: 9.15.1
```
## Understanding the structure
Expand Down Expand Up @@ -533,6 +533,24 @@ Logical used
| ZAPI | `aggr-efficiency-get-iter` | `aggr-efficiency-info.aggr-efficiency-cumulative-info.total-data-reduction-logical-used-wo-snapshots-flexclones` | conf/zapi/cdot/9.9.0/aggr_efficiency.yaml |


### aggr_object_store_logical_used

Logical space usage of aggregates in the attached object store.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/aggr/show-space` | `object_store_logical_used` | conf/rest/9.12.0/aggr.yaml |


### aggr_object_store_physical_used

Physical space usage of aggregates in the attached object store.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/aggr/show-space` | `object_store_physical_used` | conf/rest/9.12.0/aggr.yaml |


### aggr_physical_used_wo_snapshots

Total Data Reduction Physical Used Without Snapshots
Expand Down Expand Up @@ -1133,8 +1151,8 @@ Total Disk Throughput in KBPS Across All Active Paths

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.disk-io-kbps` | conf/zapi/cdot/9.8.0/disk.yaml |
| REST | `api/private/cli/disk` | `disk_io_kbps_total` | conf/rest/9.12.0/disk.yaml |
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.disk-io-kbps` | conf/zapi/cdot/9.8.0/disk.yaml |


### disk_stats_sectors_read
Expand All @@ -1143,8 +1161,8 @@ Number of Sectors Read

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.sectors-read` | conf/zapi/cdot/9.8.0/disk.yaml |
| REST | `api/private/cli/disk` | `sectors_read` | conf/rest/9.12.0/disk.yaml |
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.sectors-read` | conf/zapi/cdot/9.8.0/disk.yaml |


### disk_stats_sectors_written
Expand All @@ -1153,8 +1171,8 @@ Number of Sectors Written

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.sectors-written` | conf/zapi/cdot/9.8.0/disk.yaml |
| REST | `api/private/cli/disk` | `sectors_written` | conf/rest/9.12.0/disk.yaml |
| ZAPI | `storage-disk-get-iter` | `storage-disk-info.disk-stats-info.sectors-written` | conf/zapi/cdot/9.8.0/disk.yaml |


### disk_total_data
Expand Down Expand Up @@ -4475,8 +4493,8 @@ The time (in hundredths of a second) that the CPU has been doing useful work sin

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| ZAPI | `system-node-get-iter` | `node-details-info.cpu-busytime` | conf/zapi/cdot/9.8.0/node.yaml |
| REST | `api/private/cli/node` | `cpu_busy_time` | conf/rest/9.12.0/node.yaml |
| ZAPI | `system-node-get-iter` | `node-details-info.cpu-busytime` | conf/zapi/cdot/9.8.0/node.yaml |


### node_cpu_domain_busy
Expand Down Expand Up @@ -7847,6 +7865,15 @@ Specifies the bucket logical used size up to this point. This field cannot be sp
| REST | `api/protocols/s3/buckets` | `logical_used_size` | conf/rest/9.7.0/ontap_s3.yaml |


### ontaps3_object_count



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/vserver/object-store-server/bucket` | `object_count` | conf/rest/9.7.0/ontap_s3.yaml |


### ontaps3_size

Specifies the bucket size in bytes; ranges from 190MB to 62PB.
Expand Down Expand Up @@ -12727,6 +12754,24 @@ Average latency in microseconds for the WAFL filesystem to process all the opera
| ZAPI | `perf-object-get-instances volume` | `avg_latency`<br><span class="key">Unit:</span> microsec<br><span class="key">Type:</span> average<br><span class="key">Base:</span> total_ops | conf/zapiperf/cdot/9.8.0/volume.yaml |


### volume_capacity_tier_footprint



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/footprint` | `volume_blocks_footprint_bin1` | conf/rest/9.12.0/volume.yaml |


### volume_capacity_tier_footprint_percent



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/footprint` | `volume_blocks_footprint_bin1_percent` | conf/rest/9.12.0/volume.yaml |


### volume_filesystem_size

Filesystem size (in bytes) of the volume. This is the total usable size of the volume, not including WAFL reserve. This value is the same as Size except for certain SnapMirror destination volumes. It is possible for destination volumes to have a different filesystem-size because the filesystem-size is sent across from the source volume. This field is valid only when the volume is online.
Expand Down Expand Up @@ -12937,6 +12982,24 @@ Number of NFS write operations per second to the volume
| ZAPI | `perf-object-get-instances volume` | `nfs_write_ops`<br><span class="key">Unit:</span> per_sec<br><span class="key">Type:</span> rate<br><span class="key">Base:</span> | conf/zapiperf/cdot/9.8.0/volume.yaml |


### volume_num_compress_attempts



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/efficiency/stat` | `num_compress_attempts` | conf/rest/9.12.0/volume.yaml |


### volume_num_compress_fail



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/efficiency/stat` | `num_compress_fail` | conf/rest/9.12.0/volume.yaml |


### volume_other_latency

Average latency in microseconds for the WAFL filesystem to process other operations to the volume; not including request processing or network communication time
Expand Down Expand Up @@ -12987,6 +13050,24 @@ The reserved size (in bytes) that is not available for new overwrites. The numbe
| ZAPI | `volume-get-iter` | `volume-attributes.volume-space-attributes.overwrite-reserve-used` | conf/zapi/cdot/9.8.0/volume.yaml |


### volume_performance_tier_footprint



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/footprint` | `volume_blocks_footprint_bin0` | conf/rest/9.12.0/volume.yaml |


### volume_performance_tier_footprint_percent



| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume/footprint` | `volume_blocks_footprint_bin0_percent` | conf/rest/9.12.0/volume.yaml |


### volume_read_data

Bytes read per second
Expand Down Expand Up @@ -13267,6 +13348,26 @@ Percentage of the logical used size of the volume.This parameter is not supporte
| ZAPI | `volume-get-iter` | `volume-attributes.volume-space-attributes.logical-used-percent` | conf/zapi/cdot/9.8.0/volume.yaml |


### volume_space_performance_tier_inactive_user_data

The size that is physically used in the performance tier of the volume and has a cold temperature. This parameter is only supported if the volume is in an aggregate that is either attached to object store or could be attached to an object store.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume` | `performance_tier_inactive_user_data` | conf/rest/9.12.0/volume.yaml |
| ZAPI | `volume-get-iter` | `volume-attributes.volume-space-attributes.performance-tier-inactive-user-data` | conf/zapi/cdot/9.8.0/volume.yaml |


### volume_space_performance_tier_inactive_user_data_percent

The size (in percent) that is physically used in the performance tier of the volume and has a cold temperature. This parameter is only supported if the volume is in an aggregate that is either attached to object store or could be attached to an object store.

| API | Endpoint | Metric | Template |
|--------|----------|--------|---------|
| REST | `api/private/cli/volume` | `performance_tier_inactive_user_data_percent` | conf/rest/9.12.0/volume.yaml |
| ZAPI | `volume-get-iter` | `volume-attributes.volume-space-attributes.performance-tier-inactive-user-data-percent` | conf/zapi/cdot/9.8.0/volume.yaml |


### volume_space_physical_used

The size (in bytes) that is physically used in the volume.This differs from 'total-used' space by the space that is reserved for future writes.The value includes blocks in use by Snapshot copies.This field is valid only if the volume is online.
Expand Down

0 comments on commit 9221f35

Please sign in to comment.