You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the X-Ray Java SDK, the default streaming strategy is to wait until there are 100 segments to send (export to the X-Ray Daemon for publishing) and then sending them all at once:
This is a problem when instrumented Lambdas timeout and segments that have ended and are ready to be published aren't because they were waiting (for example) the 99th span to finish when the application timed out.
Users can already set the streaming strategy as so:
The text was updated successfully, but these errors were encountered:
NathanielRN
changed the title
Default streaming strategy should export segments immediately upon ending
Default streaming strategy for Lambda should export segments immediately upon ending
Mar 9, 2022
I'm not sure that is how this code behaves? I believe the DEFAULT_MAX_SEGMENT_SIZE = 100; refers to the maximum number of subsegments within a single segment.
This code (as I understand it), is specifically there to enable creation of extremely large segments, with potentially thousands of subsegments. The code counts up how many completed subsegments exist and once it crosses this threshold (100), it will send off a batch of subsegments to the x-ray daemon for forwarding to AWS.
Segments (as I have observed), are sent to the daemon immediately upon ending, and the daemon sends these to AWS typically within a second (though lambda may have different behavior).
For lambda timeouts specifically, I'm unsure of the behavior, though I have seen the retries appear later as 1 massive segment with all attempts in a single segment (might be mistaken, we don't use lambda much)
Description
In the X-Ray Java SDK, the default streaming strategy is to wait until there are 100 segments to send (export to the X-Ray Daemon for publishing) and then sending them all at once:
aws-xray-sdk-java/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/DefaultStreamingStrategy.java
Lines 25 to 27 in a2bc1ad
This means that the streaming strategy for Lambda, which follows the recorder's streaming strategy, also batches segments:
aws-xray-sdk-java/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/contexts/LambdaSegmentContext.java
Lines 126 to 128 in a2bc1ad
This is a problem when instrumented Lambdas timeout and segments that have ended and are ready to be published aren't because they were waiting (for example) the 99th span to finish when the application timed out.
Users can already set the streaming strategy as so:
But this should be the default behavior for Lambda. We do this in other SDKs:
We do not do it in the following languages even though we should:
The text was updated successfully, but these errors were encountered: