To send trace data to your Google Cloud project you can use the Telemetry (OTLP) API or the Cloud Trace API. The Telemetry API implements the OpenTelemetry OTLP API, and it provides greater compatibility and support for the open source OpenTelemetry ecosystem. The Trace API is a proprietary Google Cloud API which predates support for the Telemetry API. The limits for the Telemetry API are often more generous than for the Trace API.
Trace API quotas and limits
This section provides information about quotas and limits that apply only to the Trace API. The quotas and limits listed in this section don't apply to the Telemetry API.
Cloud Trace enforces two different types of quotas: a rate quota on your Cloud Trace API requests and an ingestion quota on spans you send to Trace.
Quotas
The following table summarizes the quota units available for read and write
operations, and the daily quota for ingesting spans for the
Trace API. For example,
you have a total of 300 per 60 seconds for the three API
commands GetTrace, ListTraces, and ListSpan. Here are two different
examples of how you could use all of the available quota units:
- Make 12
ListTracesAPI calls per 60 seconds. - Make 10
ListTracesAPI calls and 50GetTraceAPI calls per 60 seconds.
| Category | Total quota units |
|---|---|
| Read operations1 | 300 per 60 seconds |
| Write operations2 | 4,800 per 60 seconds |
| Ingested spans3,4 | 3,000,000 per day - 5,000,000,000 per day |
1 Read operations include GetTrace, ListTraces,
ListSpan. A call to ListTraces consumes 25 quota units. Calls to
GetTrace consume ListSpan 1 quota unit. Querying and viewing traces
using the Trace Explorer in the Google Cloud console doesn't consume
this quota.
2 Write operations include PatchTraces, BatchWrite,
and CreateSpan. Each write operation consumes 1 quota unit.
3 This quota only applies to spans ingested using the Cloud Trace API.
Ingestion through the Telemetry API is unrestricted.
4 Your daily trace span ingestion quota for the Cloud Trace API is
determined by your billing account history and requests you have made for quota
increases.
Limits
This table lists the limits for the Cloud Trace API.
| Description | Value |
|---|---|
Maximum number of spans per GetTrace call |
10,000 |
Maximum number of spans per PatchTraces call |
25,000 |
Maximum number of traces per ListTraces call |
1,000 in the ROOTSPAN and MINIMAL views100 in the COMPLETE view |
| Maximum length of a span name | 1024 bytes |
| Maximum number of labels or attributes per span | 1024 |
| Maximum size of key for a label or attribute | 512 bytes |
| Maximum size of value for a label or attribute | 65,532 bytes |
| Maximum number of events per span | 256 |
| Maximum past timestamp for a span to be ingested | 14 days |
| Maximum future timestamp for a span to be ingested | 3 days |
| Maximum past timestamp for event relative to span timestamp | 365 days |
Exceeding a limit might not result in an API call failing with an error. For example, an error isn't reported when the number of attributes attached a span exceeds 1024. Instead, in this scenario, the Cloud Trace API uses a non-deterministic algorithm to select 1024 attributes to ingest. The remaining attributes are discarded.
The Cloud Trace API provides details about the
GetTrace, PatchTraces, and
ListTraces endpoints.
How you annotate spans depends on the Cloud Trace API endpoint. If you use the
batchWrite endpoint, then add attributes to the
Span object. If you use the
patchTraces endpoint, then add labels to the