Viewing usage reports

Compute Engine lets you export detailed reports of your Compute Engine usage to a Cloud Storage bucket using the usage export feature.

Usage reports provide information about the lifetime of your resources. For example, you can see how many VM instances in your project are running an n2-standard-4 machine type and how long each instance has been running. You can also review the storage space of a persistent disk, and information about other Compute Engine features.

Usage reports don't provide billing or activity information, such as information about API requests. For billing information, see Export Cloud Billing data to BigQuery. For a record of administrative activities and accesses within your Google Cloud resources, see Audit logs.

Before you begin

  • If you haven't already, set up authentication. 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:

    gcloud

    1. Install the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:

      gcloud init

      If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

    2. Set a default region and zone.

    Python

    To use the Python samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.

    1. Install the Google Cloud CLI.

  • If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  • If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  • For more information, see Set up authentication for a local development environment.