View autoscaler logs Stay organized with collections Save and categorize content based on your preferences.
When you enable autoscaling, the autoscaler makes scaling decisions based on theoptions that you specify. Each scaling decision is logged byCloud Logging. Read these logs in theLogs Explorer to better understandthe autoscaler's scaling decisions.
Using the Logs Explorer, you can see events related to:
- Autoscaler recommendation for resizing a managed instance group (MIG). If theautoscaler calculates a new recommended size for a MIG, the change in therecommended size is described in the autoscaler logs. SeeResize log entry.
- Changes in autoscaler status. For example, if the autoscaler was working asexpected but then encountered an issue, the change in status wouldbe described in the autoscaler logs. SeeStatus change log entry.
Before you begin
- Read theAutoscaling documentation.
- Have an active autoscaler for which you want to view logs.
- Review how to use theLogs Explorer.
- 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 autoscaler logs
To view autoscaler logs, use the Google Cloud console, thegcloud CLI, or REST.
Console
If you've turned on autoscaling, then you can see autoscaling logs in theGoogle Cloud console.
- Go to theLogs Explorer page.
- Pull down theResource drop-down menu and selectAutoscaler.
You can also navigate to theLogs Explorer page from your MIG asfollows:
In the Google Cloud console, go to theInstance groups page.
Click the name of the MIG for which you want to view the logs.
ClickMonitoring tab.
In theMonitoring tab, theLogs panel is at the bottom of thepage. Expand the panel by clicking thekeyboard_capslockToggle panel "Logs"at the end of this panel.
To open theLogs explorer page, clickopen_in_newView in logs explorer.
The log explorer opens with a default query to fetch all autoscaler logsof the MIG.
gcloud
To look up all logs related to autoscaling, use thelogging read command.For example:
gcloud logging read "resource.type=autoscaler" --limit 10 \ --format json
To view the autoscaler logs of a specific MIG, specify theinstance_group_manager_name as follows:
gcloud logging read "resource.type=autoscaler AND \resource.labels.instance_group_manager_name=example-igm" \ --limit 10 --format json
To view the log entries related to autoscalerresize actions, specify thecompute.autoscalers.resize methodname:
gcloud logging read "resource.type=autoscaler AND \ resource.labels.instance_group_manager_name=example-igm AND \protoPayload.methodName=compute.autoscalers.resize" \ --limit 10 --format json
To view the log entries related to autoscalerstatus changes, specify thecompute.autoscalers.changeStatusmethod name:
gcloud logging read "resource.type=autoscaler AND \ resource.labels.instance_group_manager_name=example-igm AND \protoPayload.methodName=compute.autoscalers.changeStatus" \ --limit 10 --format json
REST
Make a request to theLogging V2 API.The request body must contain thefilter parameter to use when searchingfor logs and theproject you want to view logs for. For example, to makea request to get a list of resize actions of a specific MIG:
POST https://logging.googleapis.com/v2/entries:list{ "filter": "resource.type=autoscaler AND resource.labels.instance_group_manager_name=example-igm AND protoPayload.methodName=compute.autoscalers.resize", "pageSize": 10, "resourceNames": [ "projects/example-project" ]}To make a request to get a list of status changes of a specific MIG:
POST https://logging.googleapis.com/v2/entries:list{ "filter": "resource.type=autoscaler AND resource.labels.instance_group_manager_name=example-igm AND protoPayload.methodName=compute.autoscalers.changeStatus", "pageSize": 10, "resourceNames": [ "projects/example-project" ]}Resize log entry
When the autoscaler calculates arecommended size for your MIG,Compute Engine creates a log entry. This entry includes the new andold recommended sizes, and the reason for the change in recommendation.
The following is an example of a log entry for a zonal MIG. In this example,based on predictive autoscaling the autoscaler calculated3 VMs to achieve theCPU utilization target of35%. But, the maximum number of instancesconfigured in the autoscaling policy is only2. So, the autoscaler limits therecommended size to2.
{ insertId: "1l68z7sg4jw7kzo" logName: "projects/example-project/logs/cloudaudit.googleapis.com%2Fsystem_event" protoPayload: { @type: "type.googleapis.com/google.cloud.audit.AuditLog" metadata: { @type: "type.googleapis.com/autoscaler.AutoscalerSizeChangeExplanation" autoscalingMode: "ON"autoscalingReason: { scalingLimit: { limitPolicy: { maxNumReplicas: 2 } limitSize: 2 name: "MAX_INSTANCES" } scalingSignal: { calculatedSize: 3 calculationDetails: { servingSize: 1 signalTarget: 0.35 signalValue: 1.03533 } name: "PREDICTED_CPU_UTILIZATION" signalPolicy: { coolDownPeriodSec: 15 cpuUtilization: { predictiveMethod: "OPTIMIZE_AVAILABILITY" utilizationTarget: 0.35 } } } summary: "The autoscaler's recommended size changed from 1 to 2 because the autoscaler predicted that in 15 seconds the average CPU utilization across 1 serving instance will be 103.533%, which is above the utilization target of 35%. The calculated size was 3 to achieve the target CPU utilization but the size was limited by the maximum number of instances set in the autoscaling policy." }newSize: 2 oldSize: 1 }methodName: "compute.autoscalers.resize" resourceName: "projects/example-project/zones/us-east1-d/autoscalers/example-autoscaler" serviceName: "compute.googleapis.com" } receiveTimestamp: "2022-06-13T22:34:43.045973046Z" resource: { labels: { autoscaler_id: "1234567890123456789" autoscaler_name: "example-autoscaler" instance_group_manager_id: "1357908642148074125" instance_group_manager_name: "example-igm" location: "us-east1-d" project_id: "example-project" } type: "autoscaler" } severity: "INFO" timestamp: "2022-06-13T22:34:42.810216614Z" }The following table describes the fields from the log entry:
| Property | Value |
|---|---|
autoscalingMode | Theautoscaling mode at the time when the entry was logged. Regardless of the mode, the autoscaler calculates therecommended size, which is represented bynewSize in the log. Depending on the autoscaling mode, the autoscaler resizes the MIG as follows:
|
autoscalingReason | Details about the reason for autoscaling. |
autoscalingReason.scalingLimit | Details about the autoscaling feature that limited thecalculatedSize, which is the size that autoscaler calculated based on the autoscaling signal. The autoscaling features that can limit thecalculatedSize are maximum or minimum number of instances, thescale-in controls, or thestabilization period. If no limit applies tocalculatedSize, then thescalingLimit field does not appear in the logs. |
autoscalingReason.scalingLimit.limitPolicy | The configuration of the autoscaling feature that limited thecalculatedSize. ThelimitPolicy field is not set when stabilization limits thecalculatedSize because stabilization is a default feature of autoscaling. |
autoscalingReason.scalingLimit.limitSize | The number of VMs based on the autoscaling feature that limited thecalculatedSize. |
autoscalingReason.scalingLimit.name | The name of the autoscaling feature that limited thecalculatedSize. |
autoscalingReason.scalingSignal | Details about the autoscaling signal that is used to calculate the number of VMs the MIG should have. If the autoscaling policy hasmultiple signals, then the autoscaler considers the signal that requires the largest number of VMs. |
autoscalingReason.scalingSignal.calculatedSize | The number of VMs that the MIG should have based on the autoscaling signal. IfscalingLimit applies, then the autoscaler limitscalculatedSize toscalingLimit.limitSize. |
autoscalingReason.scalingSignal.calculationDetails | Details used to determine thecalculatedSize.
|
autoscalingReason.scalingSignal.name | The name of the autoscaling signal based on which the autoscaler calculated the number of VMs, represented bycalculatedSize in the log. |
autoscalingReason.scalingSignal.signalPolicy | The configuration of the autoscaling signal based on which the autoscaler determined thecalculatedSize. |
autoscalingReason.summary | A description of the reason for autoscaling. |
newSize | The current recommended size of the MIG. Depending on theautoscalingMode, the autoscaler resizes the MIG to thenewSize as follows:
|
oldSize | The previous recommended size of the MIG. |
For information about the other fields in the log entry, seeFormat of audit log entries.
Status change log entry
When the status of the autoscaler changes, Compute Engine createsa log entry capturing the old and new status messages. You can use these statusmessages to find out why your autoscaler is not behaving as you expect or todebug past issues you noticed. For some of the common status messages, seeCommonly returned status messages.
The following fields in theprotoPayload describe the old and new statuses:
metadata.newStatus.details: The new status of the autoscaler.metadata.oldStatus.details: The previous status of the autoscaler.
The following is an example of a log entry that describes a status change. Inthis example, you might notice the new status message indicating problems withyour load balancing configuration.
{ insertId: "ivho6kg4icqfio" logName: "projects/example-project/logs/cloudaudit.googleapis.com%2Fsystem_event" protoPayload: { metadata: { @type: "type.googleapis.com/autoscaler.AutoscalerStatusChange"newStatus: { details: "The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any utilization data from the load balancer or the utilization is constantly 0. Check that the load balancing configuration is working" }oldStatus: { details: "OK" },methodName: "compute.autoscalers.changeStatus" resourceName: "projects/example-project/zones/us-east1-b/autoscalers/example-autoscaler" serviceName: "compute.googleapis.com" } receiveTimestamp: "2022-06-08T03:54:12.332329320Z" resource: { labels: { autoscaler_id: "1234567890123456789" autoscaler_name: "example-autoscaler" instance_group_manager_id: "1357908642148074125" instance_group_manager_name: "example-igm" location: "us-east1-b" project_id: "example-project" } type: "autoscaler" } severity: "INFO" timestamp: "2022-06-08T03:54:10.675416812Z" } }For information about the other fields in the log entry, seeFormat of audit log entries.
What's next
- Update your autoscaler using information that you received from the logs.
- Learn howautoscaler makes decisions.
- Reviewautoscaling options.
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 2026-02-18 UTC.