Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
hjgraca opened this issue Sep 27, 2024 · 0 comments · Fixed by #771
Closed
2 tasks done

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

hjgraca opened this issue Sep 27, 2024 · 0 comments · Fixed by #771
Assignees
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

Comments

@hjgraca
Copy link
Contributor

hjgraca commented Sep 27, 2024

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

@hjgraca hjgraca added feature-request New or enhancements to existing features triage Pending triage from maintainers labels Sep 27, 2024
@hjgraca hjgraca self-assigned this Sep 27, 2024
@hjgraca hjgraca added area/metrics Core metrics utility and removed triage Pending triage from maintainers labels Sep 27, 2024
@hjgraca hjgraca moved this to 📋 Backlog in Powertools for AWS Lambda (.NET) Sep 27, 2024
@hjgraca hjgraca added the v2 v2 release label Oct 25, 2024
@hjgraca hjgraca added this to the Metrics V2 milestone Jan 20, 2025
@hjgraca hjgraca moved this from 📋 Backlog to 🏗 In progress in Powertools for AWS Lambda (.NET) Feb 17, 2025
@hjgraca hjgraca linked a pull request Feb 20, 2025 that will close this issue
7 tasks
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

1 participant