<PackageReference Include="OpenTelemetry.Api" Version="1.11.2" />

OpenTelemetry.Context.RuntimeContext

public static class RuntimeContext
Generic runtime context management API.
public static Type ContextSlotType { get; set; }

Gets or sets the actual context carrier implementation.

public static RuntimeContextSlot<T> GetSlot<T>(string slotName)

Get a registered slot from a given name.

public static T GetValue<T>(string slotName)

Gets the value from a registered slot.

public static object GetValue(string slotName)

Gets the value from a registered slot.

public static RuntimeContextSlot<T> RegisterSlot<T>(string slotName)

Register a named context slot.

public static void SetValue<T>(string slotName, T value)

Sets the value to a registered slot.

public static void SetValue(string slotName, object value)

Sets the value to a registered slot.