-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operationid algo screws up sampling algo #160
Comments
@vitalyf007 - ID is quite random. Can we change sampling algorithm to work fine on small strings? |
The decision was to concat the same string to the desired length like this. PR: microsoft/ApplicationInsights-JS#117 getSamplingHashCode: function (input) {
if (input == "") {
return 0;
}
var desiredResultLength = 8;
while (input.length < desiredResultLength){
input = input.concat(input);
input = input.substr(0, desiredResultLength);
} Unit tests: |
Adding default config for customers to find easily. Addressing #156
Tests fail in coreclr framework (in build), as TelemetryCOnfiguration…
New algorithm for creating operationid produces 6 char strings (much shorter than it used to be with guids). This seems to screw up sampling algorithm (DJB hash) which seems to not work properly on short strings (bad distribution, 98+% of hashes have score <= 20, score should be equal to distribution)
This makes sampling work incorrectly.
Proposed solution is to fall back to original guids instead of 6 char ids or investigate a use of a different hash algorithm which works on short strings (NOTE - both .net and JSSDK should use the same algorithm as both can have sampling ON and should sample in/out the same users)
The text was updated successfully, but these errors were encountered: