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
Currently there exists Subsegment.shouldPropagate() which for regular subsegments always returns true and is only false for some use-cases of AWSXrayRecorder.beginSubsegment() (when there is no segment in the thread context).
SubsegmentImpl already returns shouldPropagate() based on a variable, though no-where sets this value to anything other than true.
My use-case is, I have a code path that generates thousands of xray subsegments (calls thousands of RPCs), which in aggregate (including downstream segments), exceeds the AWSXRay trace document size limit. I was looking for a way to suppress downstream x-ray segments in other APIs and this seemed to be named for this use-case.
Alternatively, I've been considering explicitly setting Segment.setSampled(false) to false once a certain number of subsegments are created, and then back to true before the Segment is completed. This would also allow me to stop generating downstream segments from my other apis (as we propagate sampled to our downstream).
Is there another alternative to help me manage segment generation/trace document size during massive fanout like this?
The text was updated successfully, but these errors were encountered:
Control segment size by sampled flag is a good idea. Actually we are thinking about using sampled flag control the size of trace in other XRay feature since XRay trace quota has total size limit 500k bytes.
Alternatively you can use OpenTelemetry sdk instead of XRay sdk. There are several benefits for your requirement:
OpenTelemetry span is independent with each other, spans maintain parent-child relationship by SpanContext, not like XRay SDK segment POJO contains a batch of child subsegments.
OpenTelemetry provides Sampler API, you can implement a custom sampler to control the total size of trace(not span/segment).
Currently there exists
Subsegment.shouldPropagate()
which for regular subsegments always returns true and is only false for some use-cases ofAWSXrayRecorder.beginSubsegment()
(when there is no segment in the thread context).SubsegmentImpl
already returnsshouldPropagate()
based on a variable, though no-where sets this value to anything other thantrue
.My use-case is, I have a code path that generates thousands of xray subsegments (calls thousands of RPCs), which in aggregate (including downstream segments), exceeds the AWSXRay trace document size limit. I was looking for a way to suppress downstream x-ray segments in other APIs and this seemed to be named for this use-case.
Alternatively, I've been considering explicitly setting
Segment.setSampled(false)
tofalse
once a certain number of subsegments are created, and then back totrue
before the Segment is completed. This would also allow me to stop generating downstream segments from my other apis (as we propagatesampled
to our downstream).Is there another alternative to help me manage segment generation/trace document size during massive fanout like this?
The text was updated successfully, but these errors were encountered: