How to create subsegment for parallel batch processing? #4026
-
I have seen this issue that led to this doc but it does not show any usage of an auto captured AWS SDK client. In my example, I process a dynamodb stream batch and publish events to EventBridge for each record. What I wantI want custom subsegments for each record handler and I want the spans created inside them to be captured automatically and marked as child of my custom subsegment What I triedusing
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, you'll have to manually create these subsegments since the AWS X-Ray SDK always creates subsegments as children of the current active segment - this is something we don't control in Powertools for AWS but it's done by the SDK. For this type of case, I'd suggest to not instrument the AWS SDK client, and manually create the subsegments you need using the pattern described at the link you shared. We're unlikely to invest any more efforts in this version of Tracer unless there's a bug, and instead are actively looking at moving to an OpenTelemetry-based solution - but for now I don't have an ETA that I can share. |
Beta Was this translation helpful? Give feedback.
No, you'll have to manually create these subsegments since the AWS X-Ray SDK always creates subsegments as children of the current active segment - this is something we don't control in Powertools for AWS but it's done by the SDK.
For this type of case, I'd suggest to not instrument the AWS SDK client, and manually create the subsegments you need using the pattern described at the link you shared.
We're unlikely to invest any more efforts in this version of Tracer unless there's a bug, and instead are actively looking at moving to an OpenTelemetry-based solution - but for now I don't have an ETA that I can share.