NetApp / harvest

Open-metrics endpoint for ONTAP and StorageGRID
https://netapp.github.io/harvest/latest
Apache License 2.0
150 stars 37 forks source link

Add filter support for RestPerf Collector #2534

Open rahulguptajss opened 11 months ago

rahulguptajss commented 11 months ago

RestPerf Endpoint Filtering

Below are three methods for applying filters to RestPerf endpoints.

Use Case: filtering volumes by their names.

Approach 1: Cross-Field Query

Endpoint:

api/cluster/counter/tables/volume/rows?fields=*&query=test_vol&query_fields=properties.value

Limitations:

  1. Potential for false positives if other properties share the same value.

Approach 2: ID Regex Search

Endpoint:

api/cluster/counter/tables/volume/rows?fields=*&id=*test_vol*

Limitations:

  1. The ID for a volume is composed of the node, svm, volume, and uuid, formatted as node:svm:volume:uuid. This means the scope of this filtering is limited to the node, svm, and volume only.
  2. Similar to the first method, if any of the node, svm, or volume has a match with the regular expression, it may result in false positives.

Approach 3: Property Value Search

This method involves searching for a specific property value.

Endpoint:

api/cluster/counter/tables/volume/rows?fields=*&properties.value=osc_vol01

Limitations:

  1. Only properties with the specified value are returned in the response. Other properties are omitted from the results, although counters are available.
  2. As with the previous methods, this approach may also result in false positives.

Irrespective of the approach, code changes in collector will be same. Approach 1 and 2 looks good to me.