-
Notifications
You must be signed in to change notification settings - Fork 205
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
Rate limited sampling #2456
Rate limited sampling #2456
Conversation
876ce68
to
7ab8758
Compare
This pull request introduces 1 alert when merging 7ab8758 into cfb9ca6 - view on LGTM.com new alerts:
|
efefb66
to
e7d1bde
Compare
This pull request introduces 1 alert when merging e7d1bde into cfb9ca6 - view on LGTM.com new alerts:
|
e7d1bde
to
bd15ec7
Compare
This pull request introduces 1 alert when merging bd15ec7 into cfb9ca6 - view on LGTM.com new alerts:
|
69e532c
to
dd17b80
Compare
This pull request introduces 1 alert when merging e47aeaa into b13a24f - view on LGTM.com new alerts:
|
6b6cf49
to
01c823d
Compare
.../main/java/com/microsoft/applicationinsights/agent/internal/configuration/Configuration.java
Outdated
Show resolved
Hide resolved
...st/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverridesTest.java
Outdated
Show resolved
Hide resolved
.../framework/src/main/java/com/microsoft/applicationinsights/smoketest/SmokeTestExtension.java
Show resolved
Hide resolved
smoke-tests/framework/src/main/resources/default_applicationinsights.json
Show resolved
Hide resolved
This pull request introduces 1 alert when merging 01c823d into b13a24f - view on LGTM.com new alerts:
|
01c823d
to
8bb4b5b
Compare
.../main/java/com/microsoft/applicationinsights/agent/internal/configuration/Configuration.java
Outdated
Show resolved
Hide resolved
...c/main/java/com/microsoft/applicationinsights/agent/internal/sampling/AiOverrideSampler.java
Outdated
Show resolved
Hide resolved
...st/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverridesTest.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java
Show resolved
Hide resolved
fb10f70
to
9deab0e
Compare
This pull request introduces 1 alert when merging 9deab0e into b13a24f - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging d543f28 into 2170998 - view on LGTM.com new alerts:
|
two follow-ups for after this PR:
|
This pull request introduces 1 alert when merging 4758211 into 038342c - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 3641cbe into 038342c - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging e0c5098 into 86cba45 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 0b2afed into 86cba45 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 48b3d8e into 86cba45 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 1c24cd3 into 86cba45 - view on LGTM.com new alerts:
|
this proved a bit difficult, and there should be upstream log sampling at some point, so a good time to revisit this if not sooner
created a work item for this one |
ignore this, I fixed it (and others) in #2468 |
boolean standaloneTelemetry = !isRequest && !parentSpanContext.isValid(); | ||
Sampler override = samplingOverrides.getOverride(standaloneTelemetry, attributes); |
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.
boolean standaloneTelemetry = !isRequest && !parentSpanContext.isValid(); | |
Sampler override = samplingOverrides.getOverride(standaloneTelemetry, attributes); | |
boolean isStandaloneTelemetry = !isRequest && !parentSpanContext.isValid(); | |
Sampler override = samplingOverrides.getOverride(isStandaloneTelemetry , attributes); |
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.
conventionally in Java boolean fields are not prefixed with is
, while their getters are
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 pushed this change to the next PR to avoid conflicts
...c/main/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverrides.java
Show resolved
Hide resolved
...c/main/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverrides.java
Show resolved
Hide resolved
...c/main/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverrides.java
Show resolved
Hide resolved
...c/main/java/com/microsoft/applicationinsights/agent/internal/sampling/SamplingOverrides.java
Show resolved
Hide resolved
|
||
// average response time of 10 ms, times 1000 requests, equals 10 seconds | ||
// so ideally with rate of 0.5 requests per second we would get 5 requests | ||
assertThat(rdEnvelopes.size()).isLessThan(20); |
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.
why 20? expected roughly around ~5 requests?
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.
~5 requests is correct, it's somewhat random though and don't want to introduce sporadic test failures in CI
Are we planning to update the details in MS documentation around sampling? Reading through the comments and changes this looks to me as an implicit behaviour than a configurable one. |
hi @asos-jitu! yes, the documentation has been updated at https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#sampling, and once GA is released we will add mention of the behavior changes to https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent#download-the-jar-file |
Hi @trask , does rate-limiting represents adaptive sampling by definition? How the volume-based adaptation matches with adaptive sampling? https://docs.microsoft.com/en-us/azure/azure-monitor/app/sampling#adaptive-sampling |
Yes
I'm not sure I follow, can you clarify this question? |
Hi @trask, how does the following config work and be adjusted as per volume? Do we have any tests which proves the behaviour? |
Hi @trask, as per release notes rate limiting is for request types. Does that mean the other dependencies are not supported? Both percentage-based and rate-limited sampling now only apply to requests, and to telemetry that is captured in the context of a request. If you do want to sample "standalone" telemetry (e.g. startup logs), you can use sampling overrides, e.g. |
you pick one or the other, either fixed percentage, or limitPerSecond for tests, see the Sampling* smoke tests under https://github.com/microsoft/ApplicationInsights-Java/tree/main/smoke-tests/apps |
Hi @trask, given limitPerSecond caters to requests only and percentage caters to all other types including dependencies/exceptions etc. How one would sample both as that's a usual pattern? |
|
Not ready for review, design is still in flux.In this PR:
Resolves #2416
Resolves #1974 (in conjunction with PR #2443)
Resolves #1973