-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Problem
The beginSegment() method doesn't perform sampling if the caller of this method hasn't done any sampling decision.
Background
Currently sampling for a given incoming request is performed by shouldTrace(). By default, this method starts pollers in the background to fetch sampling rules from the X-Ray console and sampling is performed based on fetched sampling rules.
Usecase
Currently, shouldTrace() is only called by AWSXRayServerFilter middleware. In the scenario where a user doesn't want to use AWSXRayServletFilter middleware and instrument application using just beginSegment() and endSegment(), no sampling would be performed. This is due to limitation of beginSegment not performing sampling, if the caller of this method has not performed sampling decision. As a result, all the segments are sampled and sampling rules configured through X-Ray console doesn't have any effect.
Proposed solution
beginSegment should do sampling if the caller hasn't done any sampling.
Reference
AWS X-Ray SDK for .NET/Core has necessary implementation.
Note :
- This should be backwards compatible change.