A span represents a single operation within a trace. Spans can be
nested to form a trace tree. Often, a trace contains a root span
that describes the end-to-end latency, and one or more subspans for
its sub-operations.
A trace can also contain multiple root spans, or none at all.
Spans do not need to be contiguous. There might be
gaps or overlaps between spans in a trace.
A pointer from the current span to another span in the same trace or in a
different trace. For example, this can be used in batching operations,
where a single batch handler processes multiple requests from different
traces or when the handler receives a request from a different project.
A collection ofTimeEvents. ATimeEventis a time-stamped annotation
on the span, consisting of either user-supplied key:value pairs, or
details of a message sent/received between Spans.
[[["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."],[[["\u003cp\u003eThis document provides detailed reference information for the Google.Cloud.Trace.V2 .NET library, outlining its various versions, with the latest being 3.6.0.\u003c/p\u003e\n"],["\u003cp\u003eThe library focuses on managing traces and spans, with a \u003ccode\u003eSpan\u003c/code\u003e representing a single operation within a trace, and allowing for nested structures.\u003c/p\u003e\n"],["\u003cp\u003eKey classes include \u003ccode\u003eAttributeValue\u003c/code\u003e, \u003ccode\u003eBatchWriteSpansRequest\u003c/code\u003e, \u003ccode\u003eModule\u003c/code\u003e, \u003ccode\u003eSpan\u003c/code\u003e, \u003ccode\u003eStackTrace\u003c/code\u003e, and \u003ccode\u003eTruncatableString\u003c/code\u003e, defining data structures and request types.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTraceService\u003c/code\u003e is presented as the central service for trace and span collection and viewing, including client classes like \u003ccode\u003eTraceServiceClient\u003c/code\u003e and its builder and settings.\u003c/p\u003e\n"],["\u003cp\u003eThe content includes enums such as \u003ccode\u003eAttributeValue.ValueOneofCase\u003c/code\u003e, \u003ccode\u003eSpan.Types.SpanKind\u003c/code\u003e, and \u003ccode\u003eSpan.Types.TimeEvent.Types.MessageEvent.Types.Type\u003c/code\u003e, defining various aspects and relationships within traces and spans.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Trace v2 API - Namespace Google.Cloud.Trace.V2 (3.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.5.0/Google.Cloud.Trace.V2)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.4.0/Google.Cloud.Trace.V2)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.3.0/Google.Cloud.Trace.V2)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.2.0/Google.Cloud.Trace.V2)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.1.0/Google.Cloud.Trace.V2)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/3.0.0/Google.Cloud.Trace.V2)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/2.3.0/Google.Cloud.Trace.V2)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Trace.V2/2.2.0/Google.Cloud.Trace.V2) \n\nClasses\n-------\n\n### [AttributeValue](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.AttributeValue)\n\nThe allowed types for `[VALUE]` in a `[KEY]:[VALUE]` attribute.\n\n### [BatchWriteSpansRequest](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.BatchWriteSpansRequest)\n\nThe request message for the `BatchWriteSpans` method.\n\n### [Module](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Module)\n\nBinary module.\n\n### [Span](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span)\n\nA span represents a single operation within a trace. Spans can be\nnested to form a trace tree. Often, a trace contains a root span\nthat describes the end-to-end latency, and one or more subspans for\nits sub-operations.\n\nA trace can also contain multiple root spans, or none at all.\nSpans do not need to be contiguous. There might be\ngaps or overlaps between spans in a trace.\n\n### [Span.Types](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types)\n\nContainer for nested types declared in the Span message type.\n\n### [Span.Types.Attributes](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.Attributes)\n\nA set of attributes as key-value pairs.\n\n### [Span.Types.Link](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.Link)\n\nA pointer from the current span to another span in the same trace or in a\ndifferent trace. For example, this can be used in batching operations,\nwhere a single batch handler processes multiple requests from different\ntraces or when the handler receives a request from a different project.\n\n### [Span.Types.Link.Types](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.Link.Types)\n\nContainer for nested types declared in the Link message type.\n\n### [Span.Types.Links](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.Links)\n\nA collection of links, which are references from this span to a span\nin the same or different trace.\n\n### [Span.Types.TimeEvent](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent)\n\nA time-stamped annotation or message event in the Span.\n\n### [Span.Types.TimeEvent.Types](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.Types)\n\nContainer for nested types declared in the TimeEvent message type.\n\n### [Span.Types.TimeEvent.Types.Annotation](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.Types.Annotation)\n\nText annotation with a set of attributes.\n\n### [Span.Types.TimeEvent.Types.MessageEvent](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.Types.MessageEvent)\n\nAn event describing a message sent/received between Spans.\n\n### [Span.Types.TimeEvent.Types.MessageEvent.Types](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.Types.MessageEvent.Types)\n\nContainer for nested types declared in the MessageEvent message type.\n\n### [Span.Types.TimeEvents](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvents)\n\nA collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation\non the span, consisting of either user-supplied key:value pairs, or\ndetails of a message sent/received between Spans.\n\n### [SpanName](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.SpanName)\n\nResource name for the `Span` resource.\n\n### [StackTrace](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.StackTrace)\n\nA call stack appearing in a trace.\n\n### [StackTrace.Types](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.StackTrace.Types)\n\nContainer for nested types declared in the StackTrace message type.\n\n### [StackTrace.Types.StackFrame](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.StackTrace.Types.StackFrame)\n\nRepresents a single stack frame in a stack trace.\n\n### [StackTrace.Types.StackFrames](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.StackTrace.Types.StackFrames)\n\nA collection of stack frames, which can be truncated.\n\n### [TraceService](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceService)\n\nService for collecting and viewing traces and spans within a trace.\n\nA trace is a collection of spans corresponding to a single\noperation or a set of operations in an application.\n\nA span is an individual timed event which forms a node of the trace tree.\nA single trace can contain spans from multiple services.\n\n### [TraceService.TraceServiceBase](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceService.TraceServiceBase)\n\nBase class for server-side implementations of TraceService\n\n### [TraceService.TraceServiceClient](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceService.TraceServiceClient)\n\nClient for TraceService\n\n### [TraceServiceClient](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceClient)\n\nTraceService client wrapper, for convenient use.\n\n### [TraceServiceClientBuilder](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceClientBuilder)\n\nBuilder class for [TraceServiceClient](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceClient) to provide simple configuration of credentials, endpoint etc.\n\n### [TraceServiceClientImpl](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceClientImpl)\n\nTraceService client wrapper implementation, for convenient use.\n\n### [TraceServiceSettings](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceSettings)\n\nSettings for [TraceServiceClient](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TraceServiceClient) instances.\n\n### [TruncatableString](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.TruncatableString)\n\nRepresents a string that might be shortened to a specified length.\n\nEnums\n-----\n\n### [AttributeValue.ValueOneofCase](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.AttributeValue.ValueOneofCase)\n\nEnum of possible cases for the \"value\" oneof.\n\n### [Span.Types.Link.Types.Type](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.Link.Types.Type)\n\nThe relationship of the current span relative to the linked span: child,\nparent, or unspecified.\n\n### [Span.Types.SpanKind](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.SpanKind)\n\nType of span. Can be used to specify additional relationships between spans\nin addition to a parent/child relationship.\n\n### [Span.Types.TimeEvent.Types.MessageEvent.Types.Type](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.Types.MessageEvent.Types.Type)\n\nIndicates whether the message was sent or received.\n\n### [Span.Types.TimeEvent.ValueOneofCase](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.Span.Types.TimeEvent.ValueOneofCase)\n\nEnum of possible cases for the \"value\" oneof.\n\n### [SpanName.ResourceNameType](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.SpanName.ResourceNameType)\n\nThe possible contents of [SpanName](/dotnet/docs/reference/Google.Cloud.Trace.V2/latest/Google.Cloud.Trace.V2.SpanName)."]]