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

OpenTelemetry.Context.Propagation.EnvironmentVariableCarrier

public static IReadOnlyDictionary<string, string> CurrentProcess { get; }

Gets a snapshot of the current process' environment variables.

public static IReadOnlyDictionary<string, string> Capture(IEnumerable<KeyValuePair<string, string>> environmentVariables)

Captures a snapshot of the supplied environment variables using normalized environment variable names.

public static IEnumerable<string> Get<T>(T carrier, string key) where T : IEnumerable<KeyValuePair<string, string>>

Gets a value from an environment variable carrier using the supplied propagation key, which is normalized before lookup.

public static string NormalizeKey(string key)

Normalizes a propagation key to an environment variable name.

public static void Set<T>(T carrier, string key, string value) where T : IDictionary<string, string>

Sets a value on an environment variable carrier by normalizing the supplied propagation key before storing it.