MetricFilter should expose its metric definition via a `metric` property.
See original GitHub issueSay you create a MetricFilter
:
new logs.MetricFilter(this, 'MetricFilter', {
filterPattern: logs.FilterPattern.exists('$.myMetric'),
metricNamespace,
metricName,
metricValue: '$.myMetric',
logGroup
});
This filter should expose a property for the metric it defines.
// I want to call
const metric = metricFilter.metric()
// instead of
const metric = new cloudwatch.Metric({
metricName,
namespace: metricNamespace,
statistic: cloudwatch.Statistic.Maximum
})
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:5 (4 by maintainers)
Top Results From Across the Web
AWS::Logs::MetricFilter - AWS CloudFormation
The AWS::Logs::MetricFilter resource specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into ...
Read more >AWS Cloudwatch Metric Filters: are they actually case ...
They are case-sensitive, but metric generation can be different based on your metric filter setup: If you have three filters publishing to ...
Read more >Using AWS CloudWatch | Crosswalk - Pulumi
CloudWatch Metrics are uniquely defined by a name, a namespace, and zero or more dimensions. Each data point in a metric has a...
Read more >@aws-cdk/aws-logs - npm
Start using @aws-cdk/aws-logs in your project by running `npm i ... You can expose a metric on a metric filter by calling the ......
Read more >Cloudwatch Filter Pattern Regex
This debugger is a hidden gem that helps write and test metric filter Patterns. ... With CloudWatch Logs Insights, you can search and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep, that’s a good idea.
I would recommend a getter instead of a method.