-
Notifications
You must be signed in to change notification settings - Fork 99
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
Update README.md #363
Update README.md #363
Conversation
Codecov Report
@@ Coverage Diff @@
## master #363 +/- ##
============================================
+ Coverage 58.39% 58.41% +0.01%
- Complexity 1228 1229 +1
============================================
Files 133 133
Lines 5011 5011
Branches 589 589
============================================
+ Hits 2926 2927 +1
Misses 1814 1814
+ Partials 271 270 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
README.md
Outdated
boolean toSample = false; | ||
for (SQSMessage message: event.getRecords()) { | ||
if (SQSMessageHelper.isSampled(message)) { | ||
toSample = 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.
Wouldn't this always sample the subsegment even when a single message in the batch is sampled?
I thought how oversampling mitigation would work is that when processing each message in the batch, we decided whether to begin a subsegment with/without sampling based on if the message is sampled or not.
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 wanted to demonstrate how to do a fan-in.
README.md
Outdated
if (toSample) { | ||
AWSXRay.beginSubsegment("Processing Message"); | ||
} else { | ||
AWSXRay.beginSubsegmentWithoutSampling("Processing Message"); | ||
} | ||
|
||
// Do your procesing work here | ||
System.out.println("Doing processing work"); | ||
|
||
// End your subsegment | ||
AWSXRay.endSubsegment(); | ||
|
||
return "Success"; |
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.
If we are processing each message in the batch, shouldn't this code be inside the for loop?
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.
See comment above.
README.md
Outdated
@@ -228,6 +228,43 @@ try { | |||
``` | |||
Note that in the closure-based example above, exceptions are intercepted automatically. | |||
|
|||
### Oversampling Mitigation | |||
Oversampling mitigation allows you to ignore a parent segment/subsegment's sampled flag and instead set it to false. | |||
The code below demonstrates overriding the sampled flag based on the SQS messages sent to Lambda. |
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 think this can be reworded to explain what is happening a little more clearly.
"The code below demonstrates creating a sampled or un-sampled subsegment based on the sampling status of each SQS message processed by Lambda"
^^ How does something like this sound?
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.
+1
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 want to show how to do a fan-in. I don't think the rewording reflects that.
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.
LGTM!
README.md
Outdated
@@ -228,6 +228,70 @@ try { | |||
``` | |||
Note that in the closure-based example above, exceptions are intercepted automatically. | |||
|
|||
### Oversampling Mitigation | |||
Oversampling mitigation allows you to ignore a parent segment/subsegment's sampled flag and instead set it to false. |
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 think this sentence still needs some rewording - it is unclear what "it" is referring to here
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.
LGTM
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.