Consumption Monitoring

You can monitor usage of the Earth Engine API by Cloud Project from the Cloud Console. Specifically, the metrics page shows basic metrics including traffic (number of requests), errors and latency (per API method, response code or credentials). The quotas page shows the amount of stored assets in bytes and the number of read requests for the assets. The credentials page shows which credentials (e.g, service accounts) have been used to access the API.

In addition to the standard Google Cloud API metrics, Earth Engine consumption metrics (Beta) are available to track your project's use of Earth Engine resources.

Navigate to the Metrics Explorer, and click "Select a metric" to choose one of the Earth Engine metrics to add to the chart. You may need to adjust the time range and aggregation method to observe data for your project.

Earth Engine metrics are split into compute usage metrics (as EECU-seconds) and storage metrics. You can further break down the data using other labels:

Metric Description Available type
Used EECU-seconds An EECU is an Earth Engine Compute Unit, which is a measure of processing power. The total amount of compute work performed by a task or request is expressed in EECU-seconds. compute_type: The type of computation. One of [online, batch, highvolume].

client_type: This is an optional label that represents the API client type used for the request. In many cases, the client type is not set. When it is set, common values are ee-js/latest or ee-py/0.1.###
Used Bytes The number of bytes of asset storage used for a given project. N/A

Units

To coax the Metrics Explorer to show units on the interactive graph, click the "Aggregation" field in your query and choose "Configure aligner" from the resulting menu. This replaces the aggregation operation with two new operations: "Grouping" and "Alignment function".

Choosing "Grouping: Sum by compute_type" and "Alignment function: Sum" will construct a graph with explicit units. Experiment with different grouping labels or secondary groupings - sky's the limit!

Workload Tags

Workload tags are labels for monitoring specific computations within Earth Engine. Use setDefaultWorkloadTag to bind all computations in the script to a default workload tag unless one is explicitly set with ee.data.setWorkloadTag, in which case the default is overridden. These methods set the workload_tag label for specific computations and export tasks. You can then monitor and track individual computations in the Cloud Console. To view data the Monitoring data associated with workload tags, navigate to the Metrics Explorer.

From within the Metrics Explorer, change the selected Resource & Metric to "Earth Engine Cloud Project - Used EECUs", then group by workload_tag. Learn more about creating and managing labels in the Cloud Monitoring documentation.

For example, to monitor the EECUs used for an image computation and/or and export:

Code Editor (JavaScript)

// Cloud masking function.
function maskL8sr(image) {
  var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
  var saturationMask = image.select('QA_RADSAT').eq(0);

  // Apply the scaling factors to the appropriate bands.
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);

  // Replace the original bands with the scaled ones and apply the masks.
  return image.addBands(opticalBands, null, true)
      .addBands(thermalBands, null, true)
      .updateMask(qaMask)
      .updateMask(saturationMask);
}

// Set a default workload tag.
ee.data.setDefaultWorkloadTag('landsat-compositing')
var collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
                     .filterDate('2020-01-01', '2021-01-01')
                     .map(maskL8sr);
var composite = collection.select('SR_B.').median();
print(composite);

// Set a new workload tag.
ee.data.setWorkloadTag('export-jobs');
Export.image.toAsset(composite);
ee.data.resetWorkloadTag(); // Reset to landsat-compositing

ee.data.resetWorkloadTag(true); // Reset back to empty

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap

Colab (Python)

# Authenticate, then initialize with your Cloud Project.
ee.Initialize(project='your-project')

# Set a default workload tag.
ee.data.setDefaultWorkloadTag('landsat-compositing')
composite = (
    ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
    .filterDate('2020-01-01', '2021-01-01')
    .median()
)

# Set a workload tag for export.
ee.data.setWorkloadTag('export-jobs')
ee.batch.Export.image.toAsset(composite).start()
ee.data.resetWorkloadTag()

# Alternatively, use a workload tag with with.
with ee.data.workloadTagContext('export-jobs'):
  ee.batch.Export.image.toAsset(composite).start()

In this example, all computations are annotated with the landsat-compositing tag (set as default), and the export gets its own workload tag since ee.data.setWorkloadTag is called before running it. Use ee.data.resetWorkloadTag to set back to the default tag or to set the default tag back to an empty string.

Learn more about monitoring using the Cloud Console from these guides.