Skip to content

Feature request: Add support for default dimensions on ColdStart metric #654

Closed
@hjgraca

Description

@hjgraca

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

image

Testing with dependency injection

With this new model you can finally test Metrics with dependency injection

image

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.

image

Alternative solutions

No response

Acknowledgment

Metadata

Metadata

Assignees

Labels

area/metricsCore metrics utilityfeature-requestNew or enhancements to existing featurespending-releaseFix or implementation already in dev waiting to be releasedv2v2 release

Type

No type

Projects

Status

🏗 In progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions