You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug RateLimiingSampler and TraceIdRationBasedSampler use String.format("RateLimitingSampler{%.2f}", maxTracesPerSecond) for building a description. Formatting of numbers in such way may result in 999.00 for en_US locale and 999,00 for pl_PL.
I propose to enforce locale for those two samplers, using String.format(Locale.ENGLISH, "RateLimitingSampler{%.2f}", maxTracesPerSecond).
If that solution is acceptable, I can take care of it.
Steps to reproduce
Change locale on your JVM to pl_PL and run JaegerRemoteSamplerTest test suite. Most tests will fail on checking of description formats.
What did you expect to see?
Behavior independent of locale.
What did you see instead?
Expecting actual:
"JaegerRemoteSampler{ParentBased{root:RateLimitingSampler{999,00},remoteParentSampled:AlwaysOnSampler,remoteParentNotSampled:AlwaysOffSampler,localParentSampled:AlwaysOnSampler,localParentNotSampled:AlwaysOffSampler}}"
to contain:
"RateLimitingSampler{999.00}"
What version and what artifacts are you using?
Artifacts: opentelemetry-java, jaeger-remote-sampler
Version: fdfacb0bdea770f354e27305b5aab77a9d965a4f
Environment
Compiler: OpenJDK 18.0.1
OS: MacOS
The text was updated successfully, but these errors were encountered:
Ah I missed that JaegerRemoteSamplerTest asserts on the locale specific string! Seems reasonable to make the formatting consistent. How about using something like new DecimalFormat("#.#######").format(..) rather than tying the code to a specific locale?
Ah I missed that JaegerRemoteSamplerTest asserts on the locale specific string! Seems reasonable to make the formatting consistent. How about using something like new DecimalFormat("#.#######").format(..) rather than tying the code to a specific locale?
Describe the bug
RateLimiingSampler
andTraceIdRationBasedSampler
useString.format("RateLimitingSampler{%.2f}", maxTracesPerSecond)
for building a description. Formatting of numbers in such way may result in999.00
foren_US
locale and999,00
forpl_PL
.I propose to enforce locale for those two samplers, using
String.format(Locale.ENGLISH, "RateLimitingSampler{%.2f}", maxTracesPerSecond)
.If that solution is acceptable, I can take care of it.
Steps to reproduce
Change locale on your JVM to pl_PL and run
JaegerRemoteSamplerTest
test suite. Most tests will fail on checking of description formats.What did you expect to see?
Behavior independent of locale.
What did you see instead?
What version and what artifacts are you using?
Artifacts: opentelemetry-java, jaeger-remote-sampler
Version:
fdfacb0bdea770f354e27305b5aab77a9d965a4f
Environment
Compiler: OpenJDK 18.0.1
OS: MacOS
The text was updated successfully, but these errors were encountered: