> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/integrations/sustainability/sustainability-for-google-cloud.md).

# Sustainability for Google Cloud

## Overview

Google Cloud publishes your estimated carbon emissions through Carbon Footprint. Unlike AWS and Azure, there is **no new permission to grant**: the permission that unlocks carbon data, `billing.accounts.getCarbonInformation`, is already part of the `Billing Account Viewer` role assigned to OneLens when you connected Google Cloud.

What is needed instead is a one-time configuration step. Carbon Footprint has no query API, so the data has to be exported to BigQuery before anything can read it, in the same way the detailed usage cost export already works.

{% hint style="warning" %}

## Two steps, not one

Creating the export only delivers data from that point forward. **The transfer does not backfill by itself.** To report on anything earlier than the month you set it up, schedule a backfill as described in step 2. Skipping it leaves you with no historical baseline.
{% endhint %}

## Step 1: Create the export

You need **Project Owner** or **Project Editor** on the destination project, and `Billing Account Viewer` or `Carbon Footprint Viewer` on the billing account.

{% stepper %}
{% step %}
**Open Carbon Footprint**

In the Google Cloud console, go to **Carbon Footprint**, then select the Cloud Billing account you want to export from the **Billing account** menu.
{% endstep %}

{% step %}
**Start the export**

Click **Data export** to open the side panel, select the project the export should live in, then click **Create export**.

We recommend using the same project that already holds your `billing_export` dataset, so that carbon and cost data can be queried together.
{% endstep %}

{% step %}
**Configure the transfer**

On the BigQuery Data Transfer Service page, confirm **Source** is set to `Google Cloud Carbon Footprint Exports`, give the transfer a display name, and choose the destination dataset. An existing dataset works, or you can select **Create new dataset**.

Confirm the billing account ID shown under **Data source details**, then click **Save** and select **Allow** in the access request window.
{% endstep %}
{% endstepper %}

The transfer creates a monthly partitioned table named `carbon_footprint` and refreshes it on the 15th of each month.

## Step 2: Schedule the backfill

{% stepper %}
{% step %}
**Open the transfer**

Go to the details page of the transfer you just created.
{% endstep %}

{% step %}
**Request the backfill**

Click **Schedule Backfill**, then select **Run for a date range**.
{% endstep %}

{% step %}
**Choose the full range**

Set the start date to **February 15, 2021**, which is the earliest date Google accepts, and the end date to today. Click **OK** to request the backfill.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
February 15, 2021 is the earliest selectable date because that run contains January 2021 data, which is the beginning of the available history.
{% endhint %}

## Step 3: Send the export location to OneLens

OneLens cannot discover where you created the export, so this is the one thing we need back from you.

{% hint style="info" %}
**Send us two values:**

* the **project ID** that holds the export
* the **dataset ID** you selected or created

The table name itself is always `carbon_footprint`, set by Google, so there is nothing to tell us about it.
{% endhint %}

These are the two values you chose in step 1. If you need to look them up again, open **BigQuery** in the console, go to **Data transfers**, and select the Carbon Footprint transfer; the destination dataset is shown on its details page. The same information is available from the CLI, where `--transfer_location` must match the region your dataset is in:

```bash
bq ls --transfer_config --transfer_location=us --project_id=<your-project-id>
```

## Step 4: Grant access if the export is outside the billing project

If the export lives in the **same project** as your `billing_export` dataset, the BigQuery roles OneLens already holds cover it and there is nothing further to do.

If you placed it in a **different project**, grant the OneLens service account the `BigQuery Data Viewer` role on that dataset. It is the same service account address you used during your original Google Cloud onboarding.

You can confirm the carbon permission is in place at any time:

```bash
gcloud iam roles describe roles/billing.viewer \
  --format="value(includedPermissions)" | tr ';' '\n' | grep -i carbon
```

This returns `billing.accounts.getCarbonInformation`. Note the `-i`: the permission name is capitalised, so a case-sensitive search returns nothing and looks like a missing permission.

## What you get in OneLens

|              | Detail                                            |
| ------------ | ------------------------------------------------- |
| Granularity  | Monthly                                           |
| History      | From January 2021, once backfilled                |
| Scopes       | Scope 1, scope 2 and scope 3, plus carbon offsets |
| Basis        | Both location-based and market-based              |
| Breakdown by | Project, service, region                          |
| Published    | On the 15th of the following month                |

## Good to know

* **Carbon Footprint covers more than 80 Google Cloud services, but not all of them.** Google names Apigee, AppSheet, Google Security Operations and Looker as not covered. If you use those, their emissions are absent from the total rather than shown as zero, and should be accounted for separately.
* **Emissions are attributed to projects, not resources.** OneLens allocates to cost centres using the project key, in the same way as cost.
* **Offsets are reported separately.** Google provides both the gross figure and a total after offsets, so you can disclose whichever your framework requires.
* **The export needs no additional IAM to read new datasets** created later in the same billing project, because the OneLens grants are made at project level.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onelens.cloud/integrations/sustainability/sustainability-for-google-cloud.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
