-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MetricFilter should expose its metric definition via a metric
property.
#1353
Comments
👍 Our convention is to expose |
Yep, that's a good idea. |
While this change is being made, is it possible to link the metric filter to the alarm? In the UI, I can look at any metric filter on a log group, and click the "create alarm" button and then when looking at the log filters, the attached alarm will show. Using CDK, this seems to be created in a disconnected fashion so when I go into the UI and look at the metric filter it doesn't show the alarm. I have to go to the alarms page and see them and it can be difficult to make the connection that this metric filter will result in an alarm. |
So I've run into this "issue" as well... Fundamentally it's a bit clunky that in order to create a metric when you have a metric filter you make sure that metric names are the same. This is the non intuitive or hard to figure out aspect of how it is now. It would be nice to have some more explicit solution though I'm not sure what it would look like... Part of the challenge is that in order to create a metric from a metric filter you need a bit more information. i.e. you need a statistic - metric filter does not have this. So I would propose adding a method to metric say, "from_metric_fitler(metric_filter, ...)" and then include the extra info needed to create a metric from a metric filter. I'm fairly confident this is possible at the type script level... I would say it should rather be on metric than on metric filter... |
I would recommend a getter instead of a method. |
It is convention to expose metrics on AWS constructs, but metric filters currently do not. This PR adds a `metric()` API that creates a metric from a metric filter with the same name and namespace. The user can specify what statistic to use, or it will default to average over 5 minutes. fixes #1353 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Say you create a
MetricFilter
:This filter should expose a property for the metric it defines.
The text was updated successfully, but these errors were encountered: