[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Trace Client - Class Trace (1.8.10)\n\nVersion latestkeyboard_arrow_down\n\n- [1.8.10 (latest)](/php/docs/reference/cloud-trace/latest/Trace)\n- [1.8.9](/php/docs/reference/cloud-trace/1.8.9/Trace)\n- [1.7.0](/php/docs/reference/cloud-trace/1.7.0/Trace)\n- [1.6.5](/php/docs/reference/cloud-trace/1.6.5/Trace)\n- [1.5.3](/php/docs/reference/cloud-trace/1.5.3/Trace)\n- [1.4.11](/php/docs/reference/cloud-trace/1.4.11/Trace) \nReference documentation and code samples for the Stackdriver Trace Client class Trace.\n\nThis plain PHP class represents a Trace resource. The model currently has no\nbacking API model and is identified by its traceId.\n\nExample: \n\n use Google\\Cloud\\Trace\\TraceClient;\n\n $traceClient = new TraceClient();\n\n $trace = $traceClient-\u003etrace();\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Trace\n\nMethods\n-------\n\n### __construct\n\nInstantiate a new Trace instance.\n\n### traceId\n\nRetrieves the trace's id.\n\nExample: \n\n echo $trace-\u003etraceId();\n\n### info\n\nReturns a serializable array representing this trace.\n\n### spans\n\nRetrieves the spans for this trace.\n\nExample: \n\n $spans = $trace-\u003espans();\n\n### span\n\nCreate an instance of [Span](/php/docs/reference/cloud-trace/latest/Span)\n\nExample: \n\n $span = $trace-\u003espan(['name' =\u003e 'newSpan']);\n\n### setSpans\n\nSet the spans for this trace.\n\nExample: \n\n $trace-\u003esetSpans([$span1, $span2]);"]]