如需将跟踪数据发送到您的 Google Cloud 项目,您可以使用遥测 (OTLP) API 或 Cloud Trace API。Telemetry API 实现了 OpenTelemetry OTLP API,并为开源 OpenTelemetry 生态系统提供了更高的兼容性和支持。Trace API 是一种专有 Google Cloud API,在支持 Telemetry API 之前就已存在。针对 Telemetry API 的限制通常比针对 Trace API 的限制更宽松。
Trace API 配额和限制
本部分提供有关仅适用于 Trace API 的配额和限制的信息。本部分列出的配额和限制不适用于 Telemetry API。
Cloud Trace 实行两种不同类型的配额:Cloud Trace API 请求的速率配额,以及发送给 Trace 的 span 的提取量配额。
配额
下表总结了可用于读取和写入操作的配额单位,以及 Trace API 的每日 Span 提取量配额。例如,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"]],["最后更新时间 (UTC):2025-08-19。"],[],[],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."]]