question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MetricFilter should expose its metric definition via a `metric` property.

See original GitHub issue

Say 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:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rix0rrrcommented, Sep 27, 2019

Yep, that’s a good idea.

0reactions
rix0rrrcommented, Jun 8, 2020

I would recommend a getter instead of a method.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found