Conversation
59be9a0 to
97276ab
Compare
97276ab to
90d4ada
Compare
90d4ada to
11b4832
Compare
jeanbisutti
left a comment
There was a problem hiding this comment.
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.
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.
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.
My suggestion was to refer to tests in the comments, in addition to the current comment explanations.
There was a problem hiding this comment.
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 abccalls, 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