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

Allow creating alarms for any metric on a Monitoring scope #286

Open
timcosta opened this issue Dec 8, 2022 · 0 comments
Open

Allow creating alarms for any metric on a Monitoring scope #286

timcosta opened this issue Dec 8, 2022 · 0 comments
Labels
feature-request New feature

Comments

@timcosta
Copy link

timcosta commented Dec 8, 2022

Feature scope

Alarms

Describe your suggested feature

Hi all! I'm wondering if it's possible to allow generic alarm creation for any MetricWithAlarmSupport on a given Monitoring scope.

Context for this question is that I'm setting up some monitoring/alarming for a Kinesis Data Firehose, and the KinesisFirehoseMonitoring class only allows passing addRecordsThrottledAlarm to the constructor, but it creates ~10 metrics that could be alarmed on. It doesnt seem possible/simple to access this without going in a roundabout way that guesses about some internal patterns by calling MonitoringFacade.createdMonitorings() and then for each entry in the returned array checking for some unique public property like title and re-constructing in where you call MonitoringFacade.monitorKinesisFirehose.

This feels like a pretty fragile way to add alarms for metrics that have been otherwise created, so I was wondering if a feature could be added that did something like take a generic { [key: string]: <GenericAlarmConfigInterface> } prop where each key is one of the MetricWithAlarmSupport fields on a Monitoring instance like incomingBytesMetric on a KinesisFirehoseMonitoring instance.

This might end up needing to be a 2.0 of this library, but unless I'm missing something in the code it's currently easy to create dashboards, but extremely hard to create alarms for many of the things on those dashboards so it may be worth it.

I can take a crack at a PR if this is a feature that there's appetite for, but I wanted to at least raise an issue/feature request to gauge appetite before opening a likely large PR.

An alternate implementation option could be to return segment; in the functions like monitorApiGateway instead of return this; which would allow people to easily access the MetricWithAlarmSupport properties for the resource they are monitoring, but that obviously removes chainability of that function which is also a breaking change.

@timcosta timcosta added the feature-request New feature label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature
Projects
None yet
Development

No branches or pull requests

1 participant