-
Notifications
You must be signed in to change notification settings - Fork 6
/
ecr_dashboard.json
63 lines (63 loc) · 2.98 KB
/
ecr_dashboard.json
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
{
"start": "-P1M",
"widgets": [
{
"type": "log",
"x": 0,
"y": 0,
"width": 24,
"height": 6,
"properties": {
"query": "SOURCE '${aws_cloudwatch_cloudtrail_log_group}' | filter @logStream = '${account_id}_CloudTrail_${aws_region}'\n\n\n\n | filter eventName = 'BatchGetImage'\n\n\n\n | fields @timestamp, @message\n\n\n\n | stats count(*) as apiCalls by userIdentity.accountId as accountId,\n\nrequestParameters.repositoryName as repository\n| sort accountId desc",
"region": "eu-central-1",
"title": "Images per Accounts",
"view": "table"
}
},
{
"type": "log",
"x": 0,
"y": 6,
"width": 12,
"height": 6,
"properties": {
"query": "SOURCE '${aws_cloudwatch_cloudtrail_log_group}' | filter @logStream = '${account_id}_CloudTrail_${aws_region}'\n\n\n\n\n\n\n\n | filter eventName = 'BatchGetImage'\n\n\n\n\n\n\n\n | fields @timestamp, @message\n\n\n\n\n\n\n\n | stats count_distinct(requestParameters.repositoryName) as Images by\nuserIdentity.accountId as accountId\n\n\n| sort Images desc",
"region": "eu-central-1",
"title": "Usage by Accounts",
"view": "pie",
"legend": {
"position": "left"
}
}
},
{
"type": "log",
"x": 12,
"y": 6,
"width": 12,
"height": 6,
"properties": {
"query": "SOURCE '${aws_cloudwatch_cloudtrail_log_group}' | filter @logStream = '${account_id}_CloudTrail_${aws_region}'\n\n\n\n\n\n\n\n | filter eventName = 'BatchGetImage'\n\n\n\n\n\n\n\n | fields @timestamp, @message\n\n\n\n\n\n\n\n | stats count_distinct(userIdentity.accountId) as Accounts by requestParameters.repositoryName as imageName \n\n\n| sort Accounts desc",
"region": "eu-central-1",
"title": "ECR Repositories Usage",
"view": "pie",
"legend": {
"position": "left"
}
}
},
{
"type": "log",
"x": 0,
"y": 12,
"width": 24,
"height": 6,
"properties": {
"query": "SOURCE '${aws_cloudwatch_cloudtrail_log_group}' | filter @logStream = '${account_id}_CloudTrail_${aws_region}'\n\n\n\n | filter eventName = 'BatchGetImage'\n\n\n\n | fields @timestamp, @message\n\n\n\n | stats count(*) as apiCalls by userIdentity.accountId as accountId,\n\nrequestParameters.repositoryName as repository, coalesce(requestParameters.imageIds.0.imageTag, requestParameters.imageIds.0.imageDigest) as tag\n| sort accountId desc",
"region": "eu-central-1",
"title": "Images and tags per accounts",
"view": "table"
}
}
]
}