ONTAP Discussions
ONTAP Discussions
When I query ONTAP cluster to get the performance metrics; dedicated URL /cluster/metrics doesn't work instead under the /cluster when explicit input of field parameter is provided it returns the data for the performance counters.
Formed URLs in both the scenarios looks as listed below :
1. https://ONTAP_CLUSTER_IP/api/cluster/metrics?interval=1h&return_timeout=15&return_records=true
Returns 0 records
2. https://ONTAP_CLUSTER_IP/api/cluster?return_records=true&return_timeout=15&fields=metric
Returns valid records
Is this expected behavior?
If yes then what is the use of /cluster/metrics ?
Solved! See The Solution
I also tried the OPs full link to /cluster/metrics, it also works on my ONTAP 9.12.1 as shown here.
I should add s51 is node management IP.
I also tried the link against cluster management IP - that also worked.
Proper (unfiltered) output for /cluster, on the other hand, reveals it's not about performance, although it does contain the latest sample.
So I think the OP's questions are answered:
- /cluster/metrics provides historic high-level metrics
- /cluster provides cluster state with various cluster information (not related to performance) including just the latest sampling of high-level metrics
- additional metrics are available via other API methods
If it doesn't work on an older version after the metrics were introduced but before 9.12.1, I suggest checking the KB or contacting Support.
I am facing the same issue. Do we have any solution for this?
Works fine for me.
Various records from the past hour (the most recent hour, sampled over 15 seconds - I got 239 of them back, which equals 59.75 minutes).
Individual record:
> Is this expected behavior?
The above is exactly what I expected to see.
> If yes then what is the use of /cluster/metrics ?
To help us retrieve historical performance metrics for the cluster. That's what the documentation says and that's what it does.
/cluster is not even related to metrics, although it happens to contain a set of the current performance metrics (which /cluster/metrics does not do) and some other information unrelated to performance metrics.
Hi @elementx . Thanks for the detailed explanation.
But I didn't any records from /cluster/metrics API. I can get the current metrics from /cluster API.
do I need to enable anything in cluster level to get the historical data?
Note:
Cluster version: 9.9.1
The first difference may be I went to: https://${CLUSTER_IP}/api/cluster/metrics?interval=1h which is slightly shorter than the URL from the original post. I haven't tried the OP's full example.
The second may be that my ONAP is 9.12.1 which is reasonable considering it's been around for a while and the OP doesn't specify any particular version.
ONTAP 9.9.1 has the same method so I think my URL should work the same but if it doesn't then it may be ONTAP 9.9.1-specific. In that case I would check the KB or ask Support.
Maybe someone with 9.9.1 can verify what they see on their end.
I also tried the OPs full link to /cluster/metrics, it also works on my ONTAP 9.12.1 as shown here.
I should add s51 is node management IP.
I also tried the link against cluster management IP - that also worked.
Proper (unfiltered) output for /cluster, on the other hand, reveals it's not about performance, although it does contain the latest sample.
So I think the OP's questions are answered:
- /cluster/metrics provides historic high-level metrics
- /cluster provides cluster state with various cluster information (not related to performance) including just the latest sampling of high-level metrics
- additional metrics are available via other API methods
If it doesn't work on an older version after the metrics were introduced but before 9.12.1, I suggest checking the KB or contacting Support.