[[["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\u003eContextTracerManager\u003c/code\u003e class manages access to the current \u003ccode\u003eIManagedTracer\u003c/code\u003e within the Google.Cloud.Diagnostics.Common namespace.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGetCurrentTraceContext()\u003c/code\u003e retrieves the current \u003ccode\u003eITraceContext\u003c/code\u003e, or null if the trace context is unknown.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGetCurrentTracer()\u003c/code\u003e provides the current \u003ccode\u003eIManagedTracer\u003c/code\u003e, or a \u003ccode\u003eNullManagedTracer\u003c/code\u003e if one has not been set.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSetCurrentTracer(IManagedTracer tracer)\u003c/code\u003e is used to set a new \u003ccode\u003eIManagedTracer\u003c/code\u003e, which is needed for each new trace context.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Diagnostics.Common - Class ContextTracerManager (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.ContextTracerManager)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.ContextTracerManager)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.ContextTracerManager)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.ContextTracerManager)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.ContextTracerManager)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.ContextTracerManager) \n\n public static class ContextTracerManager\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common class ContextTracerManager.\n\nManages access to the current [IManagedTracer](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IManagedTracer). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ContextTracerManager \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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \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\nMethods\n-------\n\n### GetCurrentTraceContext()\n\n public static ITraceContext GetCurrentTraceContext()\n\nGets the current [ITraceContext](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ITraceContext) as defined by the [GetCurrentTracer()](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ContextTracerManager#Google_Cloud_Diagnostics_Common_ContextTracerManager_GetCurrentTracer)\nor null if the current trace context is not known at the time.\n\n### GetCurrentTracer()\n\n public static IManagedTracer GetCurrentTracer()\n\nGets the current [IManagedTracer](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IManagedTracer) or a [NullManagedTracer](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.NullManagedTracer) if none exists.\n\n### SetCurrentTracer(IManagedTracer)\n\n public static void SetCurrentTracer(IManagedTracer tracer)\n\nSets the current [IManagedTracer](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IManagedTracer). This is called for each new trace context."]]