diff --git a/src/OpenTelemetry.AutoInstrumentation/Configuration/TracerSamplerHelper.cs b/src/OpenTelemetry.AutoInstrumentation/Configuration/TracerSamplerHelper.cs index a2290f5e1..152772585 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Configuration/TracerSamplerHelper.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Configuration/TracerSamplerHelper.cs @@ -14,6 +14,7 @@ // limitations under the License. // +using System.Globalization; using OpenTelemetry.Trace; namespace OpenTelemetry.AutoInstrumentation.Configuration; @@ -47,7 +48,8 @@ internal static class TracerSamplerHelper var ratio = defaultRatio; - if (double.TryParse(arguments, out var parsedRatio) && parsedRatio >= 0.0 && parsedRatio <= 1.0) + if (double.TryParse(arguments, NumberStyles.Any, CultureInfo.InvariantCulture, out var parsedRatio) + && parsedRatio >= 0.0 && parsedRatio <= 1.0) { ratio = parsedRatio; }