Feature Request: LATEST keyword for metric dimensions #26946
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Currently, all metric dimensions need to be populated with specific values that match your metrics. Just as we have metric math function keywords, I'd like to be able to use keywords for dimension maps.
Specifically, I'd like a CDK option to query the latest value added to a dimension.
Use Case
I'm using CDK to monitor metrics for my mobile app. I'd like an option to query a metric by the latest app version automatically, without having to update the version number manually.
For example, my metric dimensions currently look something like this:
I propose a keyword so that I can achieve the same results like this:
Proposed Solution
I propose adding a LATEST keyword that automatically detects and populates the dimension with the corresponding value that was added most recently.
For example, in regards to app versions, we would query the latest value added to the AppVersion dimension. CDK would identify that metrics with version "13.2" started coming in later than metrics with version "13.1", and return 13.2 as the latest value.
This requires CDK to track time stamps of when each value in a dimension was added, so a simpler solution is to just add this functionality for values that can be parsed into numerics by removing all non-numerical characters in a string. For example, "13.2" would be parsed into "132", and this would be evaluated as higher than "131" (from version "13.1"), so CDK will return "13.2" as the latest value.
Other Information
Some use cases may log the latest values as lowest values, so perhaps the keyword would be separated out into LOWEST and HIGHEST. These could also be options in the LATEST enum: Latest.LOWEST and Latest.HIGHEST.
Acknowledgements
CDK version used
2.79.1
Environment details (OS name and version, etc.)
macOS 13.3.1
The text was updated successfully, but these errors were encountered: