traceId.hashCode() Adding Math#abs (#5506)

This commit is contained in:
linliaoy 2020-09-17 16:38:52 +08:00 committed by GitHub
parent 2ebb5bdf3a
commit f80d851964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -32,6 +32,6 @@ public class TraceSegmentSampler {
}
public boolean shouldSample(String traceId) {
return traceId.hashCode() % 10000 < traceSampleRateWatcher.getSampleRate();
return Math.abs(traceId.hashCode()) % 10000 < traceSampleRateWatcher.getSampleRate();
}
}