View and understand MIG insights Stay organized with collections Save and categorize content based on your preferences.
Managed instance group (MIG) insights help you understand the CPU and memoryusage of the virtual machine (VM) instances that are part of your MIG.These insights are generated automatically based on system metricsor metrics gathered by the Cloud Monitoring service.You can use these insights to support decisionsabout resizing your MIG's machine type to more efficiently use VM resources.
For more information about insights, seeInsights.
Before you begin
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
View insights for MIG recommendations
Compute Engine generatesmachine type recommendationsbased on resourceinsights.By viewing insights associated with a specific MIG,you can learn more about the CPU and memory usage for your MIG.
To view the insights that generated a specific recommendation, usethe gcloud CLI or REST.
Permissions required for this task
To perform this task, you must have the followingpermissions:
recommender.computeInstanceGroupManagerCpuUsageInsights.geton the projectrecommender.computeInstanceGroupManagerCpuUsageInsights.liston the projectrecommender.computeInstanceGroupManagerCpuUsagePredictionInsights.geton the projectrecommender.computeInstanceGroupManagerCpuUsagePredictionInsights.liston the projectrecommender.computeInstanceGroupManagerCpuUsageTrendInsights.geton the projectrecommender.computeInstanceGroupManagerCpuUsageTrendInsights.liston the projectrecommender.computeInstanceGroupManagerMemoryUsageInsights.geton the projectrecommender.computeInstanceGroupManagerMemoryUsageInsights.liston the projectrecommender.computeInstanceGroupManagerMemoryUsagePredictionInsights.geton the projectrecommender.computeInstanceGroupManagerMemoryUsagePredictionInsights.liston the project
gcloud
To view all the available insights in detail for a specific zone, use theinsights list command.
gcloud recommender insights list --project=PROJECT_ID \ --location=LOCATION \ --insight-type=INSIGHT_TYPE_ID \ --format=FORMAT
Replace the following:
PROJECT_ID: the ID of your project.LOCATION: the zone that contains theresources for which you want to view insights.INSIGHT_TYPE_ID: the id of theinsight type. For a list ofthe VM insights available, seeTypes of MIG insights.FORMAT: your preferred outputformat–for example,json.
A typical output of theinsights list command using thejson outputformat might look like the following.
[ { "name": "projects/PROJECT_ID/locations/us-central1-a/insightTypes/google.compute.instanceGroupManager.CpuUsagePredictionInsight/insights/0ec21a13-bb04-3121-7321-dc43a11cc3e3", "description": "Predicted CPU usage is 1.5 vCPUs.", "targetResources": [ "//compute.googleapis.com/projects/PROJECT_ID/zones/us-central1-a/instanceGroupManagers/test-instance" ], "insightSubtype": "CPU_USAGE_PREDICTION", "lastRefreshTime": "2021-09-15T06:50:45Z", "observationPeriod": "14 days", "stateInfo": { "state": "ACTIVE" }, "content": { "predictedCpuCores": 1.5 }, "category": "PERFORMANCE", "etag": "fds421j2340", "associatedRecommendations": [ { "recommendation": "projects/PROJECT_ID/locations/us-central1-a/recommenders/google.compute.instanceGroupManager.MachineTypeRecommender/recommendations/0fd31b24-cc05-4132-8431-ed54a22dd4f1" } ] }]REST
To view all the available insights in detail for a specific zone, use theinsights.list method.
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/INSIGHT_TYPE_ID/insights
Replace the following:
PROJECT_ID: the ID of your project.LOCATION: the zone that contains theresources for which you want to view insights.INSIGHT_TYPE_ID: the id of theinsight type. For a list ofthe VM insights available, seeTypes of MIG insights.
A typical output of theinsights.list method might looklike the following.
[ { "name": "projects/PROJECT_ID/locations/us-central1-a/insightTypes/google.compute.instanceGroupManager.CpuUsagePredictionInsight/insights/0ec21a13-bb04-3121-7321-dc43a11cc3e3", "description": "Predicted CPU usage is 1.5 vCPUs.", "targetResources": [ "//compute.googleapis.com/projects/PROJECT_ID/zones/us-central1-a/instanceGroupManagers/test-instance" ], "insightSubtype": "CPU_USAGE_PREDICTION", "lastRefreshTime": "2021-09-15T06:50:45Z", "observationPeriod": "14 days", "stateInfo": { "state": "ACTIVE" }, "content": { "predictedCpuCores": 1.5 }, "category": "PERFORMANCE", "etag": "fds421j2340", "associatedRecommendations": [ { "recommendation": "projects/PROJECT_ID/locations/us-central1-a/recommenders/google.compute.instanceGroupManager.MachineTypeRecommender/recommendations/0fd31b24-cc05-4132-8431-ed54a22dd4f1" } ] }]For more information about insights, see thereference docs.
Types of MIG insights
You can use different insights to retrieve information about theperformance of your MIGs. Each insight type has specific content attributes.
The following sections provide a reference for the MIG insights available.
CPU usage insight
Compute Engine creates CPU usage insights when the CPU usage ofyour MIGs has been higher or lower than usual for the last observation period.
The insight type ID isgoogle.compute.instanceGroupManager.CpuUsageInsight.
The available subtypes are:
HIGH_CPU_USAGELOW_CPU_USAGE
These are associated with insight descriptions such as the following:
In the last 7 days for 80% of the time, CPU usage was greater than or equalto 83% for the least utilized VM instance. In the last 7 days for 80% of thetime, CPU usage was greater than or equal to 93% for the most utilized VMinstance.In the last 7 days for 80% of the time, CPU usage was lower than or equal to10% for the most utilized VM instance. In the last 7 days for 80% of thetime, CPU usage was lower than or equal to 3% for the least utilized VMinstance.
The following table provides some details about the content associated withCPU usage insights.
| Attribute | Type | Description |
pointsForLeastUtilizedVm | ARRAY | Array of objects. Each object contains the following properties:
|
pointsForMostUtilizedVm | ARRAY | Array of objects. Each object contains the following properties:
|
CPU usage prediction insight
Compute Engine creates CPU usage prediction insights to indicatethe predicted CPU usage for the following day.
The insight type ID isgoogle.compute.instanceGroupManager.CpuUsagePredictionInsight.
A typical description you can find in this insight is similar to the following:
Predicted CPU usage of a single instance is 1.5 vCPUs.
The following table provides some details about thecontent associated with CPU usage prediction insights.
| Attribute | Type | Description |
predicted_cpu_cores | DOUBLE | Predicted amount of CPU cores. |
CPU usage trend insight
Compute Engine creates CPU usage trend insights when CPU usage showsan increasing or decreasing trend in the last observation period.
The insight type ID isgoogle.compute.instanceGroupManager.CpuUsageTrendInsight.
The available subtypes are:
CPU_USAGE_INCREASECPU_USAGE_DECREASE
These are generally associated with insight descriptions such as the following:
In the last 7 days, average daily CPU usage has increased by 8%from 65% to 73%.In the last 7 days, average daily CPU usage has decreased by 10%from 55% to 45%.
The following table provides some details about thecontent associated with CPU usage trend insights.
| Attribute | Type | Description |
cpu_usage_percentage_at_start | DOUBLE | Measured daily mean of CPU usage at the start of the observation period. The value represents the percentage of the total number of vCPUs, and is in the range [0, 100]. |
cpu_usage_percentage_at_end | DOUBLE | Measured daily mean of CPU usage at the end of the observation period. The value represents the percentage of the total number of vCPUs, and is in the range [0, 100]. |
cpu_usage_percentage_change | DOUBLE | Predicted change of daily mean of CPU usage during the observation period. Prediction uses linear regression to model the change of daily CPU usage. The value represents the percentage of the total number of vCPUs, and is in the range [0, 100]. |
Memory usage insight
Compute Engine creates memory usage insights if the memory usageis exceptionally high or low during the observation period.
The insight type ID isgoogle.compute.instanceGroupManager.MemoryUsageInsight.
The available subtypes are:
HIGH_MEMORY_USAGELOW_MEMORY_USAGE
These are generally associated with insight descriptions such as the following:
In the last 12 days for 80% of the time, memory usage was greaterthan or equal to 64%.In the last 7 days for 50% of the time, memory usage was lower thanor equal to 10%.
The following table provides some details about thecontent associated with memory usage insights.
| Attribute | Type | Description |
sample_probability | DOUBLE | Relative amount of memory usage samples below quantile function value. The value is in the range [0, 1]. |
quantile_function_lowest_value | DOUBLE | Upper bound for memory usage which holds at least part (sample probability) of samples for theleast utilized VM. The value represents the ratio of the total amount of memory, and is in the range [0, 1]. |
quantile_function_highest_value | DOUBLE | Upper bound for memory usage which holds at least part (sample probability) of samples for themost utilized VM. The value represents the ratio of the total amount of memory, and is in the range [0, 1]. |
Memory usage prediction insight
Compute Engine creates memory usage prediction insights to indicatethe memory usage predicted for the following day.
Note: You can receive memory usage insights only if you installCloud Monitoring in your VMs.The insight type ID isgoogle.compute.instanceGroupManager.MemoryUsagePredictionInsight.
A typical insight description is the following:
Predicted memory usage is 1536 MB.
The following table provides some details about thecontent associated with memory usage prediction insights.
| Attribute | Type | Description |
predicted_memory_mb | DOUBLE | Predicted amount of memory expressed in MB. |
What's next
- Learn more aboutmachine type recommendationsthat Compute Engine creates based on insights.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.