Make OTEL_TRACES_SAMPLER_ARG parsing locale invariant (#1722)
This commit is contained in:
parent
47806aca4f
commit
4096276663
|
|
@ -14,6 +14,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// </copyright>
|
// </copyright>
|
||||||
|
|
||||||
|
using System.Globalization;
|
||||||
using OpenTelemetry.Trace;
|
using OpenTelemetry.Trace;
|
||||||
|
|
||||||
namespace OpenTelemetry.AutoInstrumentation.Configuration;
|
namespace OpenTelemetry.AutoInstrumentation.Configuration;
|
||||||
|
|
@ -47,7 +48,8 @@ internal static class TracerSamplerHelper
|
||||||
|
|
||||||
var ratio = defaultRatio;
|
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;
|
ratio = parsedRatio;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue