View autoscaler logs

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

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.

  1. Go to theLogs Explorer page.

    Go to Logs Explorer

  2. Pull down theResource drop-down menu and selectAutoscaler.

You can also navigate to theLogs Explorer page from your MIG asfollows:

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Click the name of the MIG for which you want to view the logs.

  3. ClickMonitoring tab.

  4. 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.

  5. 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:

PropertyValue
autoscalingModeTheautoscaling 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:
  • ON: The autoscaler resizes the MIG tonewSize.
  • OFF: The autoscaler does not resize the MIG.
  • ONLY_SCALE_OUT: The autoscaler resizes the MIG only ifnewSize is greater than the target size of the MIG.
autoscalingReasonDetails about the reason for autoscaling.
autoscalingReason.scalingLimitDetails 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.limitPolicyThe 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.limitSizeThe number of VMs based on the autoscaling feature that limited thecalculatedSize.
autoscalingReason.scalingLimit.nameThe name of the autoscaling feature that limited thecalculatedSize.
autoscalingReason.scalingSignalDetails 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.calculatedSizeThe number of VMs that the MIG should have based on the autoscaling signal. IfscalingLimit applies, then the autoscaler limitscalculatedSize toscalingLimit.limitSize.
autoscalingReason.scalingSignal.calculationDetailsDetails used to determine thecalculatedSize.
  • servingSize: The number of VMs in the MIG excluding the VMs that are still in theirinitialization period.
  • signalTarget: The target value that the autoscaler maintains for CPU utilization (real-time), predicted CPU utilization, load balancing utilization, or a metric configured with utilization target.
  • singleInstanceAssignment: If scaling is based on a metric value that represents the total amount of work to be done, thensingleInstanceAssignment is the quantity of work that each VM can handle.
  • signalValue: The value of the autoscaling signal. IfsignalTarget is set, then the autoscaler compares thesignalValue with thesignalTarget to calculate how many VMs are needed, which is represented bycalculatedSize.
autoscalingReason.scalingSignal.nameThe name of the autoscaling signal based on which the autoscaler calculated the number of VMs, represented bycalculatedSize in the log.
autoscalingReason.scalingSignal.signalPolicyThe configuration of the autoscaling signal based on which the autoscaler determined thecalculatedSize.
autoscalingReason.summaryA description of the reason for autoscaling.
newSizeThe current recommended size of the MIG. Depending on theautoscalingMode, the autoscaler resizes the MIG to thenewSize as follows:
  • ON: The autoscaler resizes the MIG tonewSize.
  • OFF: The autoscaler does not resize the MIG.
  • ONLY_SCALE_OUT: The autoscaler resizes the MIG only ifnewSize is greater than the target size of the MIG.
oldSizeThe 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

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.