-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlambda-dashboard.yaml
71 lines (71 loc) · 2.03 KB
/
lambda-dashboard.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# yaml-language-server: $schema=../cdk.schema.json
Parameters:
DashboardName:
Type: String
Default: SampleDashboard
AllowedPattern: ^[a-zA-Z0-9-_]*$
Resources:
SampleLambda:
Type: aws-cdk-lib.aws_lambda.Function
Properties:
runtime: NODEJS_16_X
handler: index.handler
code:
aws-cdk-lib.aws_lambda.Code.fromAsset: examples/lambda-handler
memorySize: 512
timeout:
aws-cdk-lib.Duration.seconds: 10
Invocations:
Type: aws-cdk-lib.aws_cloudwatch.Metric
Call:
- SampleLambda
- metricInvocations: ~
Errors:
Type: aws-cdk-lib.aws_cloudwatch.Metric
Call:
- SampleLambda
- metricErrors: ~
Duration:
Type: aws-cdk-lib.aws_cloudwatch.Metric
Call:
- SampleLambda
- metricDuration: ~
Throttles:
Type: aws-cdk-lib.aws_cloudwatch.Metric
Call:
- SampleLambda
- metricThrottles: ~
TitleWidget:
Type: aws-cdk-lib.aws_cloudwatch.TextWidget
Properties:
markdown:
Fn::Join:
- ''
- - '# Operational Metrics: '
- !Ref SampleLambda
ServiceDashboard:
Type: aws-cdk-lib.aws_cloudwatch.Dashboard
Properties:
dashboardName: !Ref DashboardName
widgets:
- - Ref: TitleWidget
- aws-cdk-lib.aws_cloudwatch.GraphWidget:
title: Invocations
left: [Ref: Invocations]
- aws-cdk-lib.aws_cloudwatch.GraphWidget:
title: Errors
left: [Ref: Errors]
- aws-cdk-lib.aws_cloudwatch.GraphWidget:
title: Duration
left: [Ref: Duration]
- aws-cdk-lib.aws_cloudwatch.GraphWidget:
title: Throttles
left: [Ref: Throttles]
- aws-cdk-lib.aws_cloudwatch.LogQueryWidget:
logGroupNames:
- CDK::GetProp: SampleLambda.logGroup.logGroupName
queryLines:
- 'fields @timestamp, @message'
- 'sort @timestamp desc'
- 'limit 20'
width: 24