-
Notifications
You must be signed in to change notification settings - Fork 26
chore: Feature/metrics default dimensions coldstart #771
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
chore: Feature/metrics default dimensions coldstart #771
Conversation
…cs initialization. Adding default dimensions to cold start metrics
…p and refactor initialization logic
… options and enhance default dimensions handling
…ions and improve documentation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #771 +/- ##
===========================================
+ Coverage 73.43% 73.82% +0.38%
===========================================
Files 205 205
Lines 8323 8324 +1
Branches 901 901
===========================================
+ Hits 6112 6145 +33
+ Misses 1908 1884 -24
+ Partials 303 295 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…a-dotnet into feature/metrics-default-dimensions-coldstart
…ns-coldstart' into feature/metrics-default-dimensions-coldstart
…g test for empty metrics exception
…d add corresponding tests
|
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.
Hey @hjgraca! Super nice work! I just left a small comment to make the code more clear.
Issue number: #654
Summary
Changes
This pull request includes significant changes to the
AWS.Lambda.Powertools.Metrics
library, focusing on improving the interface and functionality of theMetrics
class and related components. The primary changes involve refactoring theIMetrics
interface, enhancing theMetrics
class, and updating theMetricsAspect
class to support the new configuration approach.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.
Interface and Documentation Improvements:
libraries/src/AWS.Lambda.Powertools.Metrics/IMetrics.cs
: Improved documentation for methods and parameters, and updated method signatures to provide default values for parameters.Configuration and Initialization Enhancements:
libraries/src/AWS.Lambda.Powertools.Metrics/Metrics.cs
: Introduced a newConfigure
method to set up theMetrics
instance with options, and added a staticInstance
property for easier access. Updated the class to reflect these changes and added new properties and methods to support the configuration options. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Metrics Aspect Refactoring:
libraries/src/AWS.Lambda.Powertools.Metrics/Internal/MetricsAspect.cs
: Updated theBefore
method to use the newConfigure
method for setting up theMetrics
instance and refactored the cold start metric handling to use the new configuration options. [1] [2]Minor Code Cleanups:
libraries/src/AWS.Lambda.Powertools.Metrics/Internal/MetricsAspect.cs
: Removed unnecessaryusing
statements.libraries/src/AWS.Lambda.Powertools.Metrics/Metrics.cs
: Added missingusing
statements forSystem.Diagnostics
andSystem.Threading
.These changes collectively improve the flexibility, readability, and maintainability of the
AWS.Lambda.Powertools.Metrics
library.User experience
Checklist
Please leave checklist items unchecked if they do not apply to your change.
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.