File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,28 @@ Resources:
223
223
EntryPoints:
224
224
- src/index.ts
225
225
226
+ ## Metric filters
227
+
228
+ ReceivedMetricFilter:
229
+ Type: AWS::Logs::MetricFilter
230
+ Properties:
231
+ LogGroupName: !Sub "/aws/lambda/${ EventStreamProcessing} "
232
+ FilterPattern: '{ $.received = * } ' # Matches JSON status logs
233
+ MetricTransformations:
234
+ - MetricNamespace: !Sub "${ EventStreamProcessing} "
235
+ MetricName: "ReceivedCount"
236
+ MetricValue: "$.received" # Extracts the "received" field as the metric value
237
+
238
+ FailedMetricFilter:
239
+ Type: AWS::Logs::MetricFilter
240
+ Properties:
241
+ LogGroupName: !Sub "/aws/lambda/${ EventStreamProcessing} "
242
+ FilterPattern: '{ $.received = * } ' # Matches JSON status logs
243
+ MetricTransformations:
244
+ - MetricNamespace: !Sub "${ EventStreamProcessing} "
245
+ MetricName: "FailedCount"
246
+ MetricValue: "$.failed" # Extracts the "failed" field as the metric value
247
+
226
248
## S3 Buckets
227
249
DlqBucket:
228
250
Type: AWS::S3::Bucket
You can’t perform that action at this time.
0 commit comments