-
Notifications
You must be signed in to change notification settings - Fork 207
Better sampling override behavior #4014
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
Conversation
59be9a0
to
97276ab
Compare
97276ab
to
90d4ada
Compare
90d4ada
to
11b4832
Compare
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.
Could you please make the PR title more specific? Perhaps something like "Propagate the request sampling percentage"?
...rc/main/java/com/microsoft/applicationinsights/agent/internal/exporter/AgentLogExporter.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/microsoft/applicationinsights/agent/internal/exporter/AgentLogExporter.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplerUtil.java
Show resolved
Hide resolved
...oling/src/main/java/com/microsoft/applicationinsights/agent/internal/sampling/AiSampler.java
Outdated
Show resolved
Hide resolved
...ain/java/com/microsoft/applicationinsights/agent/internal/sampling/AiSamplerForOverride.java
Outdated
Show resolved
Hide resolved
...s/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/SamplingOverrides3Test.java
Show resolved
Hide resolved
smoke-tests/apps/SamplingOverrides/src/smokeTest/resources/applicationinsights3.json
Show resolved
Hide resolved
if (!hasSamplingOverride | ||
&& spanContext.isValid() | ||
&& !spanContext.getTraceFlags().isSampled()) { | ||
// if there is no sampling override, and the log is part of an unsampled trace, |
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.
Because the scenarios are not super simple, the code comments could maybe try to refer to tests checking this scenario
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.
I totally agree that the scenarios are complex, this particular comment though I think it pretty clear (relatively, at least, compared to some of the other code in this PR)? maybe you had in mind other places?
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.
My suggestion was to refer to tests in the comments, in addition to the current comment explanations.
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.
I'd prefer to just improve the comments if they are unclear. Or if you make specific suggestions linking these to tests I'm happy to hit accept.
(icm 577578458)
Currently, this configuration:
has the unexpected effect of capturing 50% of
select count(*) from abc
calls, even when they occur within the excluded health check.this PR updates the behavior so that when a sampling override percentage is <100 and a parent dropped, then the span (with override percentage < 100) will also be dropped