Quotas & Limits

Types of Quotas

Stackdriver Trace enforces two different types of quotas: a rate quota on your API requests and an ingestion quota on spans you send to Trace.

Trace API usage limits

API method Total quota units
GetTrace1
ListTraces2
ListSpan1
300 per 60 seconds
PatchTraces1
BatchWriteSpans1
CreateSpan1
4,800 per 60 seconds

1 Each API call consumes 1 quota unit.
2 Each API call consumes 25 quota units.

You have a total of 300 quota units per second 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 ListTraces API calls per 60 seconds.
  • Make 10 ListTraces API calls and 50 GetTrace API calls per 60 seconds.

Additional restrictions and limits for the Stackdriver Trace API are:

Restrictions and limits Value
Maximum number of spans per GetTrace call 1,000
Maximum number of spans per PatchTraces call 25,000
Maximum number of traces per ListTraces call 1,000 in ROOTSPAN/Minimal view
100 in COMPLETE view
Maximum number of spans per trace 1,000
Maximum number of bytes per trace 50 MB
Maximum number of label/attributes per span 32
Size of key per label/attribute 128 bytes
Size of value per label/attribute 256 bytes

Trace daily span ingestion limit

Your daily trace span ingestion quota is determined by your billing account history and requests you have made for a quota increase. The table lists the range of quota allocations:

Category Quota units
Ingested spans 3,000,000 per day - 5,000,000,000 per day

How do quotas relate to pricing?

Stackdriver Trace pricing is based on Trace span ingestion and scanning. Ingestion reflects the number of spans received by Trace. Scanning reflects the number of spans retrieved from storage.

Daily span quotas define the limit on the number of spans that can be ingested prior to the API call failing with a resource exhausted error. API rate quotas define the limits on the rate of API calls that can be made prior to the API call failing with a resource exhausted error.

Each API call consumes API quota. Each write API call also consumes daily span ingestion quota. For example, if you need to patch 10,000 spans, you can:

  • Send one patchTraces request with the 10,000 spans.

  • Send 10,000 patchTraces requests each with 1 span, and distribute these over several minutes to avoid API quota limits.

The first approach uses 1 API quota unit and the second approach uses 10,000 API quota units. Both approaches use 10,000 daily span ingestion quota units. The price of the two approaches is the same because the price is determined by the number of spans ingested, not the number of API calls.

Trace retention periods

Category Retention period
All trace span data 30 days
Analysis reports 30 days

Managing your quota

To make sure that you do not run out of quota and lose observability into your apps' performance, periodically view your quota usage or create an alerting policy. For detailed information on monitoring your API requests and understanding their responses, see Monitoring your API usage.

  • See Viewing your quota to view your Stackdriver Trace API and your daily span ingestion quotas.

  • See Capping usage to decrease your API quota units and your daily span ingestion quota units.

  • See Requesting higher quota to request an increase in your API quota units or your daily span ingestion quotas.

  • See Creating an over-quota alert for detailed information on creating alerting policies to monitor your Trace API quota and your rate trace span ingestion.

Was this page helpful? Let us know how we did:

Send feedback about...

Stackdriver Trace Documentation