Summary
The Metrics utility can be used from within the parallel batch processor. The current operating model is:
- Create
Metrics singleton using MetricsFactory or MetricsBuilder
- 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
Summary
The Metrics utility can be used from within the parallel batch processor. The current operating model is:
Metricssingleton usingMetricsFactoryorMetricsBuilderThe 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
InheritableThreadLocalto manage Metrics instances.Acknowledgment