Pulling Datastore Metrics from VCF Operations API
- Brock Peterson

- Nov 1
- 1 min read
The VCF Operations API surface exposes metrics, for reference here are a few blogs related to this:
Today we'll discuss how to capture Datastore metrics, let's go.
First, let's authenticate. I'm going to authenticate with local credentials, but there are other ways to do this as well.

Once authenticated you can find your Datastores here.

Output (and accompanying curl commands) will look like this.

Scroll down in the Response Body to find the identifier of the Datastore you're looking for.

We can now use the GET /api/resources/{id}/stats endpoint to get metrics for this Datastore.

Scrolling down you'll notice we can specify the id and execute, which will give us our metrics (and the associated curl command).

As you can see we get all the metric values and their "key". Say for example you're looking for IOPS, Latency, and Throughput metrics for your Datastore. We can query the same endpoint for just those metrics, but first need to find their "keys". To do that, we'll use GET /api/resources/{id}/statkeys.

In the Response Body you can see the stat keys. Looking for Latency metrics we find these.

We can use these stat keys in our call to get just these metrics, like this.

Scrolling down, you'll see the Datastore id and what the execution looks like.

These are your Datastore metrics! The beauty of Swagger is that it has also provides us with all relevant curl command to be used programatically. Hope this helps!
Comments