Skip to content
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(alarm): add MathExpression support for minSampleCountToEvaluateDatapoint #466

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

ketsugi
Copy link
Contributor

@ketsugi ketsugi commented Dec 1, 2023

As discussed outside of Github, this PR adds MathExpression support for minSampleCountToEvaluateDatapoint under the following circumstances:

  1. If the MathExpression only has a single metric, convert to a sampleCount metric and use it for the minSampleCount
  2. If there are more than one metric, rely on the new optional sampleCountMetricId prop to determine which existing metric in the MathExpression should be used for the sampleCount
  3. Otherwise, throw an Error

package-lock.json Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 3ac95b1 into cdklabs:main Dec 4, 2023
11 checks passed
bamarni added a commit to bamarni/cdk-monitoring-constructs that referenced this pull request Oct 16, 2024
This provides support for `minSampleCountToEvaluateDatapoint`
when using eg. `ErrorAlarmFactory`.

See cdklabs#466
bamarni added a commit to bamarni/cdk-monitoring-constructs that referenced this pull request Oct 16, 2024
This provides support for `minSampleCountToEvaluateDatapoint`
when using eg. `ErrorAlarmFactory`.

See cdklabs#466 where the feature was introduced.
mergify bot pushed a commit that referenced this pull request Oct 16, 2024
This provides support for `minSampleCountToEvaluateDatapoint` when using eg. `ErrorAlarmFactory`. Without this change and with a `MathExpression` containing multiple metrics, one would get the following error:

> "sampleCountMetricId must be specified when using minSampleCountToEvaluateDatapoint with a multiple-metric MathExpression"

However `sampleCountMetricId` is currently not available in `CustomAlarmThreshold`.

See #466 for original change.

---

_By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants