Quotas & Limits

Trace API usage limits

The following quotas apply to your use of Stackdriver Trace:

API Call Method Class Quota units
Read 300 per 60 seconds
Write 4,800 per 60 seconds

Each API method will consume your quota at different rates, as summarized in the table below:

API Method API Call Method Class Quota unit cost per API call
GetTrace Read 1
ListTraces Read 25
ListSpans Read 1
PatchTraces Write 1
BatchWriteSpans Write 1
CreateSpan Write 1

From these 2 tables you will notice that Read API calls vary in their costs. Here are a couple of examples of how you might use your quota:

  • Make 12 ListTraces API calls per 60 seconds.
  • Make 10 ListTraces API calls and 50 GetTrace API calls per 60 seconds.

PatchTraces has the following limits enforced:

  • Number of spans per request: 25,000

GetTrace has the following limits enforced:

  • Number of traces per request: 1,000

ListTraces has the following limits enforced:

  • Number of traces per request (in ROOTSPAN/MINIMAL view): 1,000
  • Number of traces per request (in COMPLETE view): 100

Traces have the following limits enforced (per trace):

  • Number of spans: 1,000
  • Number of bytes: 50 MB

Spans have the following limits enforced (per span):

  • Number of labels/attributes: 32

Labels/Attributes have the following limits enforced (per label/attribute):

  • Size of key: 128 Bytes
  • Size of value: 256 Bytes

Managing your API usage

To make sure you are not running out of quota and losing observability into your apps’ performance, do the following on a regular basis:

  • Check your Trace quota usage: See the API dashboard for your current API activity. In the data table below the line-graph area, the Stackdriver Trace API row reflects your activity for the last 30 days. You can compare these figures to those in the Trace API usage limits section above.
  • Create an alerting policy that counts error responses for requests to cloudtrace.googleapis.com; you can use the api/request_count metric when setting the conditions of your alerting policy.

    To learn more about monitoring your API requests and their responses, see Monitoring your API usage.

Trace retention periods

Category Retention period
All trace span data 30 days
Analysis reports 30 days
Was this page helpful? Let us know how we did:

Send feedback about...

Stackdriver Trace Documentation