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

OpenTelemetry.Context.RuntimeContext

public static class RuntimeContext
Generic runtime context management API.
namespace OpenTelemetry.Context { public static class RuntimeContext { public static Type ContextSlotType { get; set; } public static RuntimeContextSlot<T> RegisterSlot<[System.Runtime.CompilerServices.Nullable(2)] T>(string slotName); public static RuntimeContextSlot<T> GetSlot<[System.Runtime.CompilerServices.Nullable(2)] T>(string slotName); public static void SetValue<[System.Runtime.CompilerServices.Nullable(2)] T>(string slotName, T value); public static T GetValue<T>(string slotName); public static void SetValue(string slotName, object value); public static object GetValue(string slotName); } }