如要將追蹤資料傳送至 Google Cloud 專案,可以使用 Telemetry (OTLP) API 或 Cloud Trace API。Telemetry API 會實作 OpenTelemetry OTLP API,並提供更高的相容性,以及對開放原始碼 OpenTelemetry 生態系統的支援。Trace API 是專屬的 Google Cloud API,支援時間早於 Telemetry API。遙測 API 的限制通常比 Trace API 寬鬆。
Trace API 配額與限制
本節提供僅適用於 Trace API 的配額和限制相關資訊。本節列出的配額和限制不適用於 Telemetry API。
Cloud Trace 強制實行的配額限制分為兩類:一種是 Cloud Trace API 要求的頻率配額,另一種則是擷取配額,用來限制傳送至 Trace 的時距數量。
配額
下表摘要列出讀取和寫入作業可用的配額單位,以及 Trace API 的每日時距擷取配額。舉例來說,以 GetTrace、ListTraces 和 ListSpan 這三個 API 指令來說,您每 60 秒共有 300 個配額單位。以下兩種做法都會完全消耗可用配額單位:
每 60 秒發出 12 個 ListTraces API 呼叫。
每 60 秒發出 10 個 ListTraces API 呼叫以及 50 個 GetTrace API 呼叫。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Quotas and limits\n\nTo send trace data to your Google Cloud project you can use the\n[Telemetry (OTLP) API](/stackdriver/docs/reference/telemetry/overview) or the\n[Cloud Trace API](/trace/api).\nThe Telemetry API implements the OpenTelemetry OTLP API, and it provides greater\ncompatibility and support for the open source OpenTelemetry ecosystem. The\nTrace API is a proprietary Google Cloud API which\npredates support for the Telemetry API. The limits for the\nTelemetry API are often more generous than for the Trace API.\n\nTrace API quotas and limits\n---------------------------\n\nThis section provides information about quotas and limits that apply only\nto the Trace API. The quotas and limits listed in this section\ndon't apply to the Telemetry API.\n\nCloud Trace enforces two different types of quotas:\na rate quota on your Cloud Trace API requests and an ingestion quota on spans you\nsend to Trace.\n\n### Quotas\n\nThe following table summarizes the quota units available for read and write\noperations, and the daily quota for ingesting spans for the\nTrace API. For example,\nyou have a total of 300 per 60 seconds for the three API\ncommands `GetTrace`, `ListTraces`, and `ListSpan`. Here are two different\nexamples of how you could use all of the available quota units:\n\n- Make 12 `ListTraces` API calls per 60 seconds.\n- Make 10 `ListTraces` API calls and 50 `GetTrace` API calls per 60 seconds.\n\n^1^ Read operations include `GetTrace`, `ListTraces`, `ListSpan`. A call to `ListTraces` consumes 25 quota units. Calls to `GetTrace` consume `ListSpan` 1 quota unit. \n^2^ Write operations include `PatchTraces`, `BatchWrite`, and `CreateSpan`. Each write operation consumes 1 quota unit. \n^3^ Your daily trace span ingestion quota is determined by your billing account history and requests you have made for quota increases.\n\n### Limits\n\nThis table lists the limits for the Cloud Trace API.\n\nExceeding a limit might not result in an API call failing with an error.\nFor example, an error isn't reported when the number of attributes attached\na span exceeds 32. Instead, in this scenario,\nthe Cloud Trace API uses a non-deterministic algorithm to select\n32 attributes to ingest. The remaining\nattributes are discarded.\n\nThe [Cloud Trace API](/trace/api) provides details about the\n[`GetTrace`](/trace/docs/reference/v1/rest/v1/projects.traces/get), [`PatchTraces`](/trace/docs/reference/v1/rest/v1/projects/patchTraces), and\n[`ListTraces`](/trace/docs/reference/v1/rest/v1/projects.traces/list) endpoints.\n\nHow you annotate spans depends on the Cloud Trace API endpoint. If you use the\n`batchWrite` endpoint, then add attributes to the\n[`Span`](/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) object. If you use the\n`patchTraces` endpoint, then add labels to the\n[`TraceSpan`](/trace/docs/reference/v1/rest/v1/projects.traces#TraceSpan) object.\n\nTelemetry API limits\n--------------------\n\nThis section lists the limits that apply only when the\n[Telemetry API](/stackdriver/docs/reference/telemetry/overview) is used to ingest trace data.\nThe Telemetry API, which implements the OpenTelemetry OTLP API, is\ndesigned for use with applications that are instrumented by using one of\nthe [OpenTelemetry SDKs](https://opentelemetry.io/docs/languages/). The limits listed in this section\ndon't apply to the Cloud Trace API.\n\n^\\*^ For a definition of this structure, see the [OpenTelemetry `trace.proto`](https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/opentelemetry/proto/trace/v1/trace.proto).\n\nLimits on trace scopes\n----------------------\n\nTrace retention periods\n-----------------------\n\nManage your quota\n-----------------\n\nThis section describes how to request a change in a quota and how to monitor\nyour quota usage.\n\n### Request changes to Cloud Trace API quota\n\nYou can request higher or lower Cloud Trace API limits using the\nGoogle Cloud console.\nFor more information, see [View and manage quotas](/docs/quotas/view-manage).\n\nIf you get an error `Edit is not allowed for this quota`, you can\n[contact Support](/stackdriver/docs/getting-support) to request changes to\nthe quota. Note also that billing must be enabled on the\nGoogle Cloud project to click the checkboxes.\n\n### Monitor you quota usage\n\nTo make sure that you don't run out of quota and lose observability into your\napps' performance, ensure that you batch your updates and monitor your\nquota usage. For example, you might create an alerting policy that notifies\nyou when your usage exceeds a threshold.\nFor detailed information on monitoring your API requests and\nunderstanding their responses, see\n[Monitoring your API usage](/apis/docs/monitoring).\n\n- To view your **Cloud Trace API** and your daily span\n ingestion quotas, see [View and manage quotas](/docs/quotas/view-manage).\n\n- To learn how to decrease your API quota units and your daily span\n ingestion quota units, see [Capping usage](/docs/quotas/view-manage#capping_usage).\n\n- To request an increase in your API quota\n units or your daily span ingestion quotas, see\n [Request more quota](/trace/docs/quotas#more-quota).\n\n- See [Creating an over-quota alert](/trace/docs/trace-alerting#over-quota-alert)\n for detailed information on creating alerting policies to monitor your\n Trace API quota and your rate trace span ingestion."]]