AWS::Logs::MetricFilter - Dimension support
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
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
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?
We also ran into this issue with lack of dimensions support in CFn for AWS::Logs::MetricFilter, though it is supported in both UI and SDK.
Would love to have this too :) It will reduce a lot the number of custom metrics/namespaces if we could use dimensions in cloudformation...
Please consider this in the roadmap
Another vote for this.
Use case:
In the console on AWS API Gateway Access logs, I can use the extract dimensions feature to extract the status, resourcePath and httpMethod values to create metrics per status code with only one log metric filter
But
In CFN I have to create a metric filter per endpoint as no dimension extraction support :-(
There is a hard limit(100) to the number of metric filters you can create per log group. So, having the dimension support is really important.
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
Already supported. Please consider implementing the support of it too!
Hi - just want to check in and see if there is any indication of when this will be implemented?
Thanks
@nicc777 it seems like it is being worked on right now:
https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/issues/64#issuecomment-1027039571
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.
We are still unable to obtain the log stream name when using the metric filter right?
This is now implemented, per https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/issues/64#issuecomment-1282769773
I should be able to hard code a dimension, rather than always pull it from a log line.
Use cases:
- Filtering lambda logs that don't contain the function name.
- Attributing logs to deployment environments (prod, qa, etc)
This could be easily achieved by allowing non-selectors as dimension values (strings that don't start with $)
this is now implemented! @alancnet i suggest opening a new issue as an enhancement so that the service team can track this work more accurately.