-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Labels
batchThis item relates to the Batch Processing UtilityThis item relates to the Batch Processing UtilitycompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentationImprovements or additions to documentation
Milestone
Description
Description of the feature request
Problem statement
As a user I want to use Tracer
while processing objects in parallel and be able to create a segments, annotate it / put metadata on it, for each one of them.
Originally suggested by @singlewind in #452.
Code examples
const tracer = new Tracer();
export const handler = async (event: Messages[]) => {
const mainSubsegment = tracer.getSegment(); // This segment is the one called ## index.handler created by Tracer
await Promise.all[
event.map((message) => new Promise((resolve, _reject) => {
const msgSubsegment = mainSubsegment.addNewSubsegment(`### Message ${message.id}`);
// process message
tracer.putMetadata('message', message.body);
msgSubsegment.close();
msgSubsegment.flush();
resolve();
});
]
}
Benefits for you and the wider AWS community
Faster handling of batch of objects, shorter execution times, cheaper executions.
Related issues, RFCs
Metadata
Metadata
Assignees
Labels
batchThis item relates to the Batch Processing UtilityThis item relates to the Batch Processing UtilitycompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentationImprovements or additions to documentation
Type
Projects
Status
Shipped