trace

Adds diagnostic information about how the request was processed.

Applies to: all services (accepted everywhere; trace output is included by latest, timeseries, batchrun, stream, archive and HTML views)

Value: IGNORE, DEFAULT, TRACE or QUERY, in increasing order of detail. The value is case sensitive. The default is DEFAULT. An unknown value is treated as DEFAULT.

https://consumer.qa.data.spglobal.com/namespace/stream?after=scan&trace=TRACE

Levels

ValueDescription
IGNORE, DEFAULTNo trace is included in the response.
TRACEAdds a trace object with the overall duration (in milliseconds), meteredCount (when non-zero), and nested spans showing per-step durations, tags and counters (such as entitlement rules and the number of messages or instances scanned, filtered and not entitled).
QUERYIncludes everything from TRACE, plus the executed database queries and their durations.

Response

Where the trace appears depends on the envelope and format:

  • With envelope=true (default in API version 2, and always for stream and archive): adds a trace field to the response envelope in JSON, XML and CBOR.
  • With envelope=false: list responses append the trace object as an extra element at the end of the list; single-record latest responses omit the trace.
  • With format=CSV: trace output is omitted.
  • With format=HTML: the trace is shown in a separate panel (including on HTML error pages), and a timer icon in the header toggles tracing on or off for the current request.
  • Errors: structured error responses (JSON, XML, plain text) do not include a trace field.

Limits

The effective trace level is capped by the maxTraceLevel setting of your account profile. Requesting a level above the cap silently lowers it to the cap.

Note: Responses with a trace are larger and slower. Use trace when investigating a problem, and quote the requestId from the response envelope when asking for help.