Whether this request should be traced or not.
May be null, which means that there's not enough information to know
whether this request should be traced or not.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eSimpleTraceContext\u003c/code\u003e is a class within the Google.Cloud.Diagnostics.Common namespace that provides a straightforward implementation of the \u003ccode\u003eITraceContext\u003c/code\u003e interface for managing trace context.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSimpleTraceContext\u003c/code\u003e class offers a constructor to create new instances, requiring parameters for \u003ccode\u003etraceId\u003c/code\u003e (string), \u003ccode\u003espanId\u003c/code\u003e (ulong?), and \u003ccode\u003eshouldTrace\u003c/code\u003e (bool?) to initialize a trace context.\u003c/p\u003e\n"],["\u003cp\u003eIt exposes read-only properties like \u003ccode\u003eShouldTrace\u003c/code\u003e (bool?), \u003ccode\u003eSpanId\u003c/code\u003e (ulong?), and \u003ccode\u003eTraceId\u003c/code\u003e (string) to provide information about whether a request should be traced, its span identifier, and its trace identifier, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThis class is part of the \u003ccode\u003eGoogle.Cloud.Diagnostics.Common.dll\u003c/code\u003e assembly and its properties correspond to the trace_id and span_id fields in the Trace and TraceSpan messages within the Google Cloud Trace API.\u003c/p\u003e\n"],["\u003cp\u003eSeveral versions of this resource are available, with version \u003ccode\u003e5.2.0\u003c/code\u003e being the most recent.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Diagnostics.Common - Class SimpleTraceContext (5.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.3.0 (latest)](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.SimpleTraceContext)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.SimpleTraceContext)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.SimpleTraceContext)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.SimpleTraceContext)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.SimpleTraceContext)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.SimpleTraceContext) \n\n public sealed class SimpleTraceContext : ITraceContext\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common class SimpleTraceContext.\n\nSimple implementation of [ITraceContext](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ITraceContext). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SimpleTraceContext \n\nImplements\n----------\n\n[ITraceContext](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ITraceContext) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Diagnostics.Common](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)\n\nAssembly\n--------\n\nGoogle.Cloud.Diagnostics.Common.dll\n\nConstructors\n------------\n\n### SimpleTraceContext(string, ulong?, bool?)\n\n public SimpleTraceContext(string traceId, ulong? spanId, bool? shouldTrace)\n\nCreates a new instance of [SimpleTraceContext](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.SimpleTraceContext).\n\nProperties\n----------\n\n### ShouldTrace\n\n public bool? ShouldTrace { get; }\n\nWhether this request should be traced or not.\nMay be null, which means that there's not enough information to know\nwhether this request should be traced or not.\n\n### SpanId\n\n public ulong? SpanId { get; }\n\nThe span id or null if none is available.\n\n**Remarks** \nThis corresponds to the span_id field of the TraceSpan message in the API.\nSee \u003chttps://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools.cloudtrace.v1#tracespan\u003e\nfor more information.\n\n### TraceId\n\n public string TraceId { get; }\n\nThe trace id or null if none is available.\n\n**Remarks** \nThis corresponds to the trace_id field of the Trace message in the API.\nSee \u003chttps://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools.cloudtrace.v1#trace\u003e\nfor more information."]]