user1142317
user1142317

Reputation: 583

Azure VM monitoring using JAVA SDK

I am using Azure Java SDK. Is there a way to find out a VM's usage metrics using the SDK like CPU and Memory?

I have already tried

ComputeUsages computeUsages = this.azure.computeUsages();
        PagedList<ComputeUsage> listByRegion = computeUsages.listByRegion(Region.US_EAST);
        for(ComputeUsage cmp : listByRegion) {
            System.out.println("Compute usage " + cmp.name().localizedValue() + " == " + cmp.currentValue());
        }

But this gets me the metric information for the region as a whole. Is there a way to get metrics on a VM basis ?

Upvotes: 1

Views: 531

Answers (1)

delMar
delMar

Reputation: 26

Short answer: not yet.

Long answer: Azure Java SDK only covers management of VMs.

For finding out about metrics, you'll need to use Azure Monitor (formerly known as Azure Insights, not to be confused with App Insights). Unfortunately, this is not (yet) part of the Java SDK.

According to this issue, this is on the roadmap, though: https://github.com/Azure/azure-sdk-for-java/issues/663

So, while you'll be able to grab these metrics via plain REST-API today, it is not yet covered by Azure SDK for Java.

Upvotes: 1

Related Questions