-
Notifications
You must be signed in to change notification settings - Fork 421
feat(metrics): add default_dimensions to single_metric #1880
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
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
Codecov ReportBase: 97.51% // Head: 97.52% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1880 +/- ##
========================================
Coverage 97.51% 97.52%
========================================
Files 143 143
Lines 6570 6573 +3
Branches 466 468 +2
========================================
+ Hits 6407 6410 +3
Misses 128 128
Partials 35 35
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a stellar PR, thank you so much for the great work! I believe the new solution is much simpler and easy to understand. Again, contributions like this one always make our day! Thanks!
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
* develop: (24 commits) chore(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1 (aws-powertools#1903) chore(deps-dev): bump aws-cdk-lib from 2.63.0 to 2.63.2 (aws-powertools#1904) update changelog with latest changes docs(idempotency): add IAM permissions section (aws-powertools#1902) chore(deps-dev): bump mkdocs-material from 9.0.10 to 9.0.11 (aws-powertools#1896) chore(deps-dev): bump mypy-boto3-appconfig from 1.26.0.post1 to 1.26.63 (aws-powertools#1895) chore(maintainers): fix release workflow rename update changelog with latest changes docs(homepage): set url for end-of-support in announce block (aws-powertools#1893) chore(deps-dev): bump mkdocs-material from 9.0.9 to 9.0.10 (aws-powertools#1888) chore(deps-dev): bump mypy-boto3-s3 from 1.26.58 to 1.26.62 (aws-powertools#1889) chore(deps-dev): bump black from 22.12.0 to 23.1.0 (aws-powertools#1886) chore(deps-dev): bump aws-cdk-lib from 2.62.2 to 2.63.0 (aws-powertools#1887) update changelog with latest changes feat(metrics): add default_dimensions to single_metric (aws-powertools#1880) chore: update v2 layer ARN on documentation bump version to 2.7.1 update changelog with latest changes docs(homepage): add banner for end-of-support v1 (aws-powertools#1879) fix(license): correction to MIT + MIT-0 (no proprietary anymore) (aws-powertools#1883) ...
Issue number: #1859
Summary
Changes
default_dimensions
keyword argument was added tosingle_metric
context manager. It accepts custom dimensions dictionary as well asmetrics.default_dimensions
.Initial I proposed
inherit_default_dimensions: bool = False
, bug when started implementing decided to go with the similar to@metrics.log_metrics
approach with specifyingdefault_dimensions
keyword argument.User experience
It was not possible to reuse default dimensions. One of the common default dimensions is Environment, once it is defined on Metrics instance it can be reused in SingleMetric as well. It is also possible to provide any other dimensions as value to
default_dimensions
.Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.