How to know whether a compute instance (it can be in a group of anything, clusters, MIG etc...) is scaled up or down in a given time period(lets say last month) programmatically?
Lets say that every instance in an managed instance group got an increase in VCPU by 2VCPUS, how to know this programmatically?
Managed Instance Groups are primarily designed for horizontal scaling.
You could use the instanceGroupManagers().listManagedInstances method to retrieve the list of instances in the MIG and use the instanceGroupManagers.aggregatedList to return the current state of instances.
However, you still need to periodically call the API and store the historical data yourself.