-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat(metrics): support high resolution metrics #1369
feat(metrics): support high resolution metrics #1369
Conversation
@dreamorosi this is a first PR Iteration, please play with the type @dreamorosi , @heitorlessa , @leandrodamascena |
added equivalent partitions to the test for addMetric with metric resolution. other partitions can not be created and used in tests , because MetricResolution Type by design does not allow other values than : [standard], [60], [High], [1] |
introduced tests and use case to support EMF Schema , which specifies StorageResolution as not required property:
extended function @dreamorosi , @heitorlessa and @leandrodamascena with this added use case and test i assume the metrics behavior to be complete . Expecting further guidance if needed for exercising further the Metrics behavior. @dreamorosi if behavior looks good , please provide hints for documentation and examples that should demonstrate and guide a developer as powertools user how to use Metric Resolution . |
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.
Great work so far, I have left a few comments here & there and all about style.
After addressing the comments please feel free to move onto proposing a change to documentation.
I think we should update this section (see corresponding section in Python) and add a new section + code snippet like this one from Python.
@dreamorosi ok, with the link sections provided in your comment above, i am able to continue the work on the documentation for the Documentation Website and snippets of code . In context of docs as comments in typescript code with IDE support, that can be considered as part of documentation unit of work , is the following i found a good reference ? Any tsdoc recommendations for the optional type metric resolution in add metric method , given is the only method exposed public with metric resolution in signature ?
The motivation of question is to introduce together for consistency reasons
|
I see what you mean. The |
Andreas this commit was an opportunity in context of unifying the docs for website, code snippet and code comments in package of metrics to refactor the code of Metrics in spaces where In summary :
// avoid unnecessary ingestion of data into cloudwatch is implemented after reading the python implementation so mentioning @heitorlessa and @leandrodamascena
|
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.
Thank you for working on this feature Niko, appreciate the help!
Let's merge it!
Description of your changes
introduction of type
MetricResolution
forMetrics
.to the type
MetricResolution
are assignable only the values 1 and 60, which mean High and Standard , respecting the EMF Documentation.addMetrics signature guides the developer to use the resolution of Metric as an optional parameter.
default metric resolution value is 60 , which means 1 minute.
developer is guided at compile time and only the values 1 and 60 can be applied to the metric resolution type.
serialized metrics include the
StorageResolution
as key , respecting the EMF Documentation.stored metrics include the resolution of metric as part of the metric definition name, unit, resolution, respecting the EMF Documentation.
How to verify this change
a new test is written in Metrics.test.ts that exercises the type of Metric Resolution
a concept test is also written to compare the DX, type of metric resolution as const vs as enum .
failing tests extended to include the
StorageResolution
as key , respecting the EMF Documentation.Related issues, RFCs
Issue number: #1277
Checklist
Breaking change checklist
Is it a breaking change?: NO
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.