generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Labels
Description
Summary
The Metrics utility can be used from within the parallel batch processor. The current operating model is:
- Create
Metricssingleton usingMetricsFactoryorMetricsBuilder - Use it from anywhere within your Lambda handler
- Flush once when the handler finishes (or max batch size is reached)
The problem in multi-threaded scenarios is that metrics configurations such as dimensions / metadata or similar will leak across threads even when flushing manually from within a thread.
Why is this needed?
This is needed to propose the expected thread-safety quality bar to customers.
Which area does this relate to?
Metrics
Solution
Use InheritableThreadLocal to manage Metrics instances.
Acknowledgment
- This request meets Powertools for AWS Lambda (Java) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, TypeScript
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Coming soon