Description
Use case
Related to aws-powertools/powertools-lambda-python#5237
Add a new DefaultDimensions
property to Metrics
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
- This feature request meets Powertools for AWS Lambda (.NET) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and TypeScript
Metadata
Metadata
Assignees
Labels
Type
Projects
Status