1

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 ?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

@MohamedUvaisM as far as I could see, there is a new directory called "azure-mgmt-monitor" on github.com/Azure/azure-sdk-for-java . So, at least it seems as if it's in the works. I didn't verify the functionality, though.
@delMar Ya i saw it, but that is planned for azure-1.0.0.beta6 version, but the current version is azure-1.0.0.beta5 which doesnt have the API for azure monitor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.