Skip to content

[bug] OTEL_TRACES_SAMPLER_ARG not parsed invariantly #6451

@dk-teknologisk-lvq

Description

@dk-teknologisk-lvq

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry 1.12.0

Runtime Version

net9.0

Description

Using the OTEL_TRACES_SAMPLER_ARG variable with the OTEL_TRACES_SAMPLER variable set to traceidratio the value will not be parsed invariantly thus being dependent on the culture of the local machine. This leads to issues when your local culture expects , as decimal delimiter instead of ., which means 0.25 will be parsed as 25 which is an invalid value.

This can be rectified at this line:

double.TryParse(configValue, out var traceIdRatio))

Steps to Reproduce

See the general description.

Expected Result

See the general description.

Actual Result

See the general description.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg:OpenTelemetryIssues related to OpenTelemetry NuGet package

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions