The functions here, aside from Dispose(), do not need to be used in most cases.
They need to be used when updating the current span in a disjoint thread.
NOTE: While it is possible to end a span in another thread any new spans after this may be in
a poor state.
[[["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\u003eThe \u003ccode\u003eISpan\u003c/code\u003e interface, part of the Google.Cloud.Diagnostics.Common namespace, represents a trace span within the Google Cloud Diagnostics framework.\u003c/p\u003e\n"],["\u003cp\u003eThe interface includes methods to annotate the span with labels, check if it has been disposed, set a stack trace, and get the span's ID.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003eDispose()\u003c/code\u003e is a standard method, the other functions in the \u003ccode\u003eISpan\u003c/code\u003e interface are typically only necessary when updating the current span in a separate thread.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eISpan\u003c/code\u003e interface is 5.2.0, with previous versions down to 4.3.1 also listed in the documentation.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Diagnostics.Common - Interface ISpan (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.ISpan)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.ISpan)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.ISpan)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.ISpan)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.ISpan)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.ISpan) \n\n public interface ISpan : IDisposable\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common interface ISpan.\n\nA trace span. \n\nInherited Members\n-----------------\n\n[IDisposable.Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)\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\nRemarks\n-------\n\n\nThe functions here, aside from [Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose), do not need to be used in most cases.\nThey need to be used when updating the current span in a disjoint thread.\n\n\nNOTE: While it is possible to end a span in another thread any new spans after this may be in\na poor state.\n\nMethods\n-------\n\n### AnnotateSpan(Dictionary\\\u003cstring, string\\\u003e)\n\n void AnnotateSpan(Dictionary\u003cstring, string\u003e labels)\n\nAnnotates the current span with the given labels.\n\n### Disposed()\n\n bool Disposed()\n\nTrue if the span has been disposed and ended.\n\n### SetStackTrace(StackTrace)\n\n void SetStackTrace(StackTrace stackTrace)\n\nAdds the given StackTrace to the current span.\n\n### SpanId()\n\n ulong SpanId()\n\nGets span's id."]]