Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

aws_cloudwatch: Stat helper does not support lower bounds, or fixed values. #29622

Open
1 of 2 tasks
everett1992 opened this issue Mar 26, 2024 · 2 comments
Open
1 of 2 tasks
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@everett1992
Copy link
Contributor

Describe the feature

There are valid statistics that cannot be created with the Stats helper

  • Range stats with open upper limits, TM(%1:) Trimmed Mean, excluding the lowest 1 percent
  • Range stats with fixed values, TM(1:2) Trimmed Mean excluding values less than 1 or greater than 2.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html

Use Case

Defining stats such as PR(1:), TC(1:2), TC(1:), TC(1%:)

Proposed Solution

I don't think mixing percent and fixed values is allowed, so I recommend an interface like this

TC({abovePercent: 10})                   // TC(10%:)
TC({abovePrecent: 10, belowPercent: 90}) // TC(10%:90%)
TC({belowPercent: 90})                   // TC(:90%)
TC({above: 10})                          // TC(10:)
TC({above: 10, below: 90})               // TC(10:90)
TC({below: 90})                          // TC(:90)

Which can be implemented as function overloads

function TC(lower: number, upper?: number)
function TC(range: PercentRange)
function TC(range: FixedRange)

Other options

  • a fixed function on the stat to switch to fixed mode
  • allow undefined for the lower bound, which mean unbounded.
TC.fixed(10, 90)
TC.fixed(undefined, 90)
  • Allow Infinity as unbounded
TC(10, Infinity)
TC(-Infinity, 90)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.133.0

Environment details (OS name and version, etc.)

NA

@everett1992 everett1992 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 26, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Mar 26, 2024
@tim-finnigan tim-finnigan self-assigned this Mar 28, 2024
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 28, 2024
@tim-finnigan
Copy link

Thank you for the feature request!

@tim-finnigan tim-finnigan added p2 effort/medium Medium work item – several days of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Mar 28, 2024
@tim-finnigan tim-finnigan removed their assignment Mar 28, 2024
@MrHen
Copy link

MrHen commented Aug 2, 2024

I just hit this issue. I needed to define three PR stats and I can't do two of them:

PR(:1000)
PR(1000:2000)
PR(2000:)

Only the middle scenario is supported.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants