aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
[AWS::Logs::MetricFilter] - [Enhancement] - Implement Hard Coded `Dimensions` Support for `match terms in unstructured log events`
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
AWS::Logs::MetricFilter
### Description
Currently it's not possible to do this:
```yaml
LogGroupFilter:
Type: AWS::Logs::MetricFilter
Properties:
FilterPattern: "?ERROR ?WARN"
LogGroupName: !Ref
MetricTransformations:
- MetricNamespace: "MetricFilter"
MetricName: "Log Error / Warning"
Dimensions:
- Key: "ClusterName"
Value: !Ref
- Key: "ServiceName"
Value: !GetAtt
MetricValue: 1
Unit: "Count"
```
CloudFormation Error message:
```
Resource handler returned message: "Invalid request provided: AWS::Logs::MetricFilter.
The specified filter pattern does not support dimensions
(Service: CloudWatchLogs, Status Code: 400, Request ID: )"
(RequestToken: , HandlerErrorCode: InvalidRequest)
```
I am not entirely sure why this limitation exists, but it doesn't make any sense. This works:
```yaml
LogGroupFilter:
Type: AWS::Logs::MetricFilter
Properties:
FilterPattern: "?ERROR ?WARN"
LogGroupName: !Ref LogGroup
MetricTransformations:
- MetricNamespace: "MetricFilter"
MetricName: "Log Error / Warning"
MetricValue: 1
Unit: "Count"
```
### Other Details
You are able to create Custom Metrics with, for example, Python and nobody is complaining about **hard coding** `Dimensions`. So i don't really get why this doesn't work.
Contributor guide
Research direction
The payload names no repository files, tests, or implementation entry points. Start by reviewing the AWS::Logs::MetricFilter resource and the supplied CloudFormation examples, then determine how support for hard-coded Dimensions with unstructured filter patterns is represented. Done means the first example is accepted without the reported CloudFormation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100