-
Notifications
You must be signed in to change notification settings - Fork 287
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
Made sampling based on UserId configurable #650
Conversation
- Moved the configuration out as far as the AdaptiveSamplingTelemetryProcessor - Added unit test to ensure sampling with/without user id is tested - Updated changelog for beta 2.5.0-beta2 - Updated PublicAPI.Unshipped.txt Linked to issue #625
/// services on operation_Id field. | ||
/// </remarks> | ||
/// </summary> | ||
public bool AllowSamplingBasedOnUserId { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow
is not the best verb here. Maybe Calculate
like in CalculateSamplingScoreFromUserId
or Use
like in UseUserIdSamplingScore
/// Default is false. | ||
/// | ||
/// <remarks> | ||
/// Calculation of the sampling score based on user_Id field is disabled by default to ensure successful correlation across many |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why are you switching to Kusto names of the fields in remark?
@@ -13,12 +13,13 @@ internal static class SamplingScoreGenerator | |||
/// Generates telemetry sampling score between 0 and 100. | |||
/// </summary> | |||
/// <param name="telemetry">Telemetry item to score.</param> | |||
/// <param name="allowUserId">Sampling score can be determined by using the Context.User.Id information, default is false.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add remark that is can be used for backward compatibility
@@ -27,8 +27,8 @@ public void SamplingScoreGeneratedUsingUserIdIfPresent() | |||
requestTelemetry.Context.User.Id = userId; | |||
requestTelemetry.Context.Operation.Id = GenerateRandomOperaitonId(); | |||
|
|||
var eventTelemetrySamplingScore = SamplingScoreGenerator.GetSamplingScore(eventTelemetry); | |||
var requestTelemetrySamplingScore = SamplingScoreGenerator.GetSamplingScore(requestTelemetry); | |||
var eventTelemetrySamplingScore = SamplingScoreGenerator.GetSamplingScore(eventTelemetry, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the name of the test method. IfPresentAndConfigured
requestTelemetry.Context.Operation.Id = operationId; | ||
requestTelemetry.Context.User.Id = userId; | ||
|
||
var eventTelemetrySamplingScore = SamplingScoreGenerator.GetSamplingScore(eventTelemetry, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ever test it with false
?
Shutting this PR down, we will simply remove our calculation of sampling score based on Context.User.Id altogether. |
Linked to issue #625
For significant contributions please make sure you have completed the following items: