Cloudformation-coverage-roadmap: AWS::Logs::MetricFilter::-Dimension support

Created on 22 Mar 2020  路  4Comments  路  Source: aws-cloudformation/cloudformation-coverage-roadmap

AWS::Logs::MetricFilter::-Dimension(s) support

2. Scope of request

Support for new attribute Dimension
AWS::Logs::MetricFilter does not support Dimension list object
Boto also does not support this and a case was raised (5852229791) https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.put_metric_filter

3. Expected behavior

It should be possible to specify a List of Dimension object that can contain values extracted from the log group metric filter

For example if I use Log::Metric filter to record as a metric my lambda memory usage. I should be able to extract the name of the lambda and also add the name of my Metric as a Dimension so that I can have better reporting.
Currently the metric name looks like this
I would rather have it so that the filter creates metrics named like this

With dimension of the lambda name or any other additional Dimension value I want to extract from the log

4. Suggest specific test cases

5. Helpful Links to speed up research and evaluation

Boto also does not support this and a case was raised (5852229791) https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.put_metric_filter
Same issue in reddit https://www.reddit.com/r/aws/comments/6dxbnz/cloudwatch_logs_metric_filter_with_dimension/

6. Category

Management

management & governance

Most helpful comment

I saw that metric filters do now support dimensions (https://aws.amazon.com/about-aws/whats-new/2021/05/amazon-cloudwatch-logs-announces-dimension-support-for-metric-filters/).

I'm trying to get some setup, but the metric filters in question are managed via CloudFormation. Looking at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html I don't see any reference to dimensions.

Does CloudFormation already support metric filter dimensions, and if so, what is the syntax? If it doesn't, is there an ETA for when it will be added?

All 4 comments

The API currently does not support this (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutMetricFilter.html), so it's currently impossible for CloudFormation (or boto3) to add this property

The API currently does not support this (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutMetricFilter.html), so it's currently impossible for CloudFormation (or boto3) to add this property

It notes this in the original request

I'd love this functionality as well, but perhaps we need to open this with the CloudWatch team?

Simple use case: Create a Metric Filter for 404 response codes on an Apache httpd web server log. I'd like to be able to query/analyze/group the resulting metrics by an {instanceid} dimension, which is in the log stream name that is sending the log events into the CloudWatch Logs group.

I saw that metric filters do now support dimensions (https://aws.amazon.com/about-aws/whats-new/2021/05/amazon-cloudwatch-logs-announces-dimension-support-for-metric-filters/).

I'm trying to get some setup, but the metric filters in question are managed via CloudFormation. Looking at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html I don't see any reference to dimensions.

Does CloudFormation already support metric filter dimensions, and if so, what is the syntax? If it doesn't, is there an ETA for when it will be added?

Was this page helpful?
0 / 5 - 0 ratings