Feature request: Add support for default dimensions on ColdStart metric #654
Labels
area/metrics
Core metrics utility
feature-request
New or enhancements to existing features
pending-release
Fix or implementation already in dev waiting to be released
v2
v2 release
Milestone
Use case
Related to aws-powertools/powertools-lambda-python#5237
Add a new
DefaultDimensions
property toMetrics
decorator to allow it to set Default Dimensions on cold start.This new property will set global default dimensions not just for the cold start
The existing SetDefaultDimensions Metrics static method will still work. If same key added it will replace that key on Metrics called after the method was called
Solution/User Experience
Metrics.Configure
You can now configure Metrics in the constructor, this allows to configure default dimensions and other properties
Testing with dependency injection
With this new model you can finally test Metrics with dependency injection
Builder pattern
You can also create a Metrics instance with Builder pattern. As you can see in the example bellow all properties can be set in the constructor and will be used on the decorated handler.
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: