-
Notifications
You must be signed in to change notification settings - Fork 154
Feature request: support high resolution metrics #1277
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
Comments
@dreamorosi i can contribute to this new feature . |
Thank you Niko, looking forward to collaborate on this one. Before starting with the implementation it'd be interesting to give some thought on whether |
@dreamorosi and @heitorlessa given a DX proposal is expressed in the use case description , I have some questions for the research.
The research is about the public addMetric(name: string, unit: MetricUnit, value: number, storageResolution?: MetricResolution): void The research should answer the following questions in steps: Is the parameter name |
Hey Niko, thanks for breaking down the topic. I would say these two:
As you correctly point out, the current storage resolution comes from the EMF specification, which we support today, so we might still need/want to stick to it. I think at this stage we just wanted to investigate if there's any similar parameter that covers a similar concept in other providers, but just for reference, Powertools for Python chose to go with the EMF parameter name and already made a release earlier today, so maybe we can do the same? |
Andrea, yes of course . because
Should i continue with these questions ?
|
Please allow me to take time to respond this next week, as soon as I have a break. @leandrodamascena had a quick research on similar systems (e.g., Prometheus), and "resolution" parameter name was the closest "neutral" to this. When we get to scope providers, we will have more thorough discussions and Tenets, as to not fall into the trap of optimising for the lowest common denominators and accidentally back ourselves into a corner we can't innovate/disagree. Have an excellent and joyful weekend everyone! |
Hi Heitor, i am commenting because i invested time early in the morning, the main trigger is curiosity . This additional comment may bring things together for further discussion with Andrea and Leandro.
Is the research based on meaning ? Because the motivation, usage scenario and end cause of resolution in Prometheus is a different one to my understanding in comparison to an act with meaning of storage and resolution . Can we look at the current research of Leandro, for learning ? and also looked how
Do you mean that the approach of deriving meaning and usage scenario is the balanced efficient method ? Additional curiosity of me by looking at the code of Metrics in powertools for typescript: In |
Hi Niko, thank you for your patience. After discussing this internally first, and then afterwards with you earlier today, we have decided to move forward with naming the new parameter simply At the moment we are focusing only on EMF as a metrics target so it makes sense to align with their naming conventions. Once we decide to open up to more providers we'll likely have to make a major release anyway, so we'll be able to have a proper discussion and potentially decide to change the name. However I appreciate you already having spent some time looking into this. So to recap, we are going to follow the specification in the first message of this thread, with the exception of the new parameter being called Below I also reply to your other questions, however I've inserted them in a collapsible block, so that we keep the conversation focused:
To be 100% honest I don't remember the thought process that made us decide that instead of just
I think we decided to go with Enums over classes and objects mostly because of the advantages described in the docs. Note that this was before we had the |
Yes as discussed with Andrea and Heitor, the parameter name will be public addMetric(name: string, unit: MetricUnit, value: number, resolution?: MetricResolution): void My next steps would be to introduce a PR as draft and discuss with you the following questions :
For the PR as draft i will consult the following:
Is that OK for you @dreamorosi , @heitorlessa and @leandrodamascena ? @dreamorosi an additional question specific to typescript , should i use enum for consistency reasons ? Or am I allowed to to introduce in the PR as draft, |
This looks good.
You're right, let's go with singular:
It's okay to look at the implementations on these two repos. I don't know how close they will be with how Metrics works in Powertools. One of the goals of the PR should be to implement the feature with the least amount of changes possible. Less changes in other areas of the code are better.
Let's try your proposal and see how it looks. Once you have a first draft I'll checkout the branch and see how it would be from a user perspective, based on that I'll decide if we keep the proposed object or revert to |
|
Use case
Amazon CloudWatch announced support for high resolution metric extraction from structured logs (EMF). Customers can now provide an optional
StorageResolution
parameter within the EMF specification with a value of 1 or 60 (default) to indicate the desired resolution (in seconds) of the metric.We should consider adding support for this new optional parameter to Metrics.
The EMF log should have this format:
As part of this issue we should also update the API docs, documentation, and unit/integration tests.
Solution/User Experience
Proposed DX:
To support the proposal, we should add a new
MetricResolutions
enum that looks similar to this:supported by types like:
as well as add a new optional parameter to the
Metrics.addMetric()
method, which would change its signature to:The change will likely also require modifying the logic of the
Metrics.storeMetric
private method to allow the new optional field.Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: