使用过滤条件搜索框中的指标过滤条件来过滤 earthengine.googleapis.com/daily_eecu_usage_time。如果您没有看到 Earth Engine compute time (EECU-time) per day in seconds 配额,请确认您已为所选项目启用 Earth Engine API。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eSet up alerts in Cloud Monitoring to receive notifications when your Earth Engine resource usage reaches a specific threshold, helping control costs and usage.\u003c/p\u003e\n"],["\u003cp\u003eConfigure chat notifications (e.g., Google Chat or Slack) to be alerted if Earth Engine compute usage for a particular workload tag exceeds a defined limit.\u003c/p\u003e\n"],["\u003cp\u003eReceive email alerts for the total in-progress EECU-time across all workload tags by configuring email as your notification channel.\u003c/p\u003e\n"],["\u003cp\u003eUnderstand that there might be a slight delay in Monitoring report propagation, resulting in non-instantaneous notifications.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the Earth Engine API to proactively monitor and cancel resource-intensive tasks that surpass a predetermined EECU-seconds limit.\u003c/p\u003e\n"]]],[],null,["# Cost controls\n\nThis page describes how to set daily limits and monitor in-progress EECU-time to\nhelp control computational costs in Earth Engine.\n\nLimit daily EECU-time\n---------------------\n\nTo help control your Earth Engine costs, you can set a limit on the amount of\nEECU-time that your project is allowed to consume in a day by updating the\nfollowing Cloud Quota:\n\n- `Earth Engine compute time (EECU-time) per day in seconds`: A project-level quota that limits the aggregate EECU-time of all users in a project.\n\nFor more information about Earth Engine quotas you can set, see [Earth Engine\nquotas](/earth-engine/guides/usage).\n| **Note:** This quota is approximate. It provides a safeguard against excessive spending, but is not designed to strictly limit EECU-time. Earth Engine might occasionally run a query that exceeds the quota limit.\n\n### Set a daily limit\n\nYou can view and edit quotas in the [**Quotas \\& System\nLimits**](https://console.cloud.google.com/iam-admin/quotas) page of the Google\nCloud console. When you adjust a quota, the change takes effect within a few\nminutes. To set or update a daily limit, do the following:\n\n1. Verify you have the [Permissions for changing project quota](https://cloud.google.com/docs/quotas/permissions#permissions_changing) on your selected project.\n2. Navigate to the [Quotas](https://console.cloud.google.com/iam-admin/quotas) page of Google Cloud console.\n3. Use the **Metric** filter in the **Filter** search box to filter for `earthengine.googleapis.com/daily_eecu_usage_time`. If you don't see the `Earth Engine compute time (EECU-time) per day in seconds` quota, verify that you have enabled the Earth Engine API for the selected project.\n4. Click **Edit quota** from the three-dot menu.\n5. If the **Unlimited** checkbox is selected, deselect it.\n6. Enter the limit in EECU-seconds you want in the **New value** field. Click **Submit Request**.\n\nFor more information about viewing and managing quotas, see [View and manage\nquotas](https://cloud.google.com/docs/quotas/view-manage).\n\n### Returned error messages\n\nAfter you set a daily limit, Earth Engine returns the following error message\nwhen you exceed it:\n\u003e Your usage exceeded the custom quota for\n\u003e 'earthengine.googleapis.com/daily_eecu_usage_time', which is adjustable by\n\u003e your administrator in the Google Cloud console:\n\u003e https://console.cloud.google.com/quotas/?project=_.\n\nOnce the quota is exceeded, Earth Engine requests will fail until the quota is\nreset the next day or the limit is increased by an administrator.\n\nFine-grained monitoring and alerting\n------------------------------------\n\nIf you need to control and monitor costs at a finer-grain than the [daily\nlimit](#daily-limits), the following recipes require more set-up but enable\nalerting and cancelation at the\n[`workload_tag`](/earth-engine/guides/monitoring_usage#workload-tags) and batch\ntask level.\n\nThese recipes use the in-progress EECU-time monitoring that's surfaced for\nrunning requests. See the [Monitoring\nusage](/earth-engine/guides/monitoring_usage) guide for more information about\nin-progress EECU-time reporting in Cloud Monitoring.\n\n### Configure alerts\n\nYou can configure alerts in Cloud Monitoring to warn you when a metric hits a\ncertain threshold. The Cloud Monitoring alerting system is very flexible. We've\ncollected a few of our favorite recipes here, but feel free to cook with custom\nconfigurations that suit your needs.\n\n#### Recipe: Chat notification for `workload_tag` usage\n\nThis example shows how to wire up a chat notification (e.g., a Google Chat\nmessage or a Slack message) if the Earth Engine compute usage for a given\n[`workload_tag`](/earth-engine/guides/monitoring_usage#workload-tags) exceeds a\nthreshold. This could be useful in the case that you have a set of export tasks\nwhich create data for your production service, and you want to be notified if\nthey collectively consume more than a certain amount of EECU-time.\n\n1. Visit the [Alerting\n page](https://console.cloud.google.com/monitoring/alerting) in the Cloud Monitoring section of the Cloud console.\n2. Choose \"Create policy\" to configure a new alerting policy.\n3. Select the metric:\n - [**In-progress EECU-seconds**](/earth-engine/guides/monitoring_usage#available_metrics) represents the number of pending (not yet successful) compute seconds.\n - You may need to deselect the \"Active\" filter to see the metric.\n4. Add a filter:\n - Use `workload_tag == your_workload_tag_value` to filter to a particular workload tag.\n - Use `compute_type = batch` or `compute_type = online` to filter to a particular type of computation.\n5. Choose an appropriate \"Rolling window\" value. If you're not sure, use `5\n min`.\n6. Select \"Sum\" from the \"Rolling window function\" menu.\n7. Choose the alert trigger and give it a name.\n8. Select the notification channels.\n - For this recipe, we'll choose \"Manage Notification Channels\" from the modal window, then \"Add New\" to paste in the Space ID of your Google Chat. This ID can be found in the URL of the Gmail or Chat page when viewing the chat.\n - If using Google Chat, you'll also need to type `@Google Cloud\n Monitoring` and select the app to add the Alerting app to your Space (if your organization allows).\n9. Choose the relevant policy and severity labels.\n10. Write a short documentation snippet.\n11. Publish your new alerting policy!\n\nOnce set, you'll get alerts in your chat space any time that the threshold is\nexceeded for your project.\n\n#### Recipe: Get email alerts for total in-progress EECU-time\n\nFollow the recipe for chat notifications, but make two changes:\n\n1. Skip the step for adding a `workload_tag` filter, so that you can see all values.\n2. When selecting a notification channel, instead of configuring a chat channel, add your email address instead.\n\n#### Alert latency and timing\n\nNote that there's a small delay in the propagation of Monitoring reports, so you\nshouldn't expect instantaneous notifications.\n\n### Cancel resource-heavy tasks\n\nGiven a limit, it's possible to use the Earth Engine API to periodically check\nthe list of pending tasks and request cancellation for any running task that\nexceeds the EECU-seconds limit.\n\n#### Recipe: Run a snippet of code in a notebook or local Python shell\n\n eecu_seconds_limit = 50 * 60 * 60 # 50 hours\n print(\"Watching for operations to cancel...\")\n while(True):\n for op in ee.data.listOperations():\n if op['metadata']['state'] == 'RUNNING':\n if op['metadata'].get('batchEecuUsageSeconds', 0) \u003e eecu_seconds_limit:\n print(f\"Cancelling operation {op['name']}\")\n ee.data.cancelOperation(op['name'])\n time.sleep(10) # 10 seconds"]]