Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edouard DE BRYE
cloud-monitor
Commits
b0db4d3e
Commit
b0db4d3e
authored
4 years ago
by
Edouard DE BRYE
Browse files
Options
Downloads
Patches
Plain Diff
Added dashboard
parent
34619583
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
deploy/dashboard.tf
+15
-0
15 additions, 0 deletions
deploy/dashboard.tf
deploy/templates/dashboards/dashboard.json.tpl
+180
-0
180 additions, 0 deletions
deploy/templates/dashboards/dashboard.json.tpl
with
196 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
b0db4d3e
...
...
@@ -37,3 +37,4 @@ terraform.rc
test/
**/node_modules/*
.vscode/
vegeta*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
deploy/dashboard.tf
0 → 100644
+
15
−
0
View file @
b0db4d3e
resource
"aws_cloudwatch_dashboard"
"main"
{
dashboard_name
=
"
${
local
.
prefix
}
-main"
dashboard_body
=
templatefile
(
"
${
path
.
module
}
/templates/dashboards/dashboard.json.tpl"
,
{
lambda_names
=
values
(
aws_lambda_function
.
crud
)[*].
function_name
dynamodb_table_name
=
aws_dynamodb_table
.
main
.
name
apigw_stage_name
=
aws_api_gateway_stage
.
main
.
stage_name
apigw_name
=
aws_api_gateway_rest_api
.
main
.
name
aws_region
=
var
.
aws_region
})
}
output
"dashboard_json"
{
value
=
aws_cloudwatch_dashboard
.
main
.
dashboard_body
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
deploy/templates/dashboards/dashboard.json.tpl
0 → 100644
+
180
−
0
View file @
b0db4d3e
{
"widgets": [
{
"height": 3,
"width": 24,
"y": 0,
"x": 0,
"type": "text",
"properties": {
"markdown": "\n# API Gateway\n"
}
},
{
"height": 3,
"width": 24,
"y": 15,
"x": 0,
"type": "text",
"properties": {
"markdown": "\n# Lambdas\n"
}
},
{
"height": 3,
"width": 24,
"y": 29,
"x": 0,
"type": "text",
"properties": {
"markdown": "\n# DynamoDB\n"
}
},
{
"height": 6,
"width": 12,
"y": 3,
"x": 0,
"type": "metric",
"properties": {
"metrics": [
[ { "expression": "100*(m1/m2)", "label": "Expression1", "id": "e1", "region": "eu-west-1" } ],
[ "AWS/ApiGateway", "4XXError", "ApiName", "$
{
apigw_name
}
", "Stage", "$
{
apigw_stage_name
}
", { "id": "m1", "visible": false } ],
[ ".", "Count", ".", ".", ".", ".", { "id": "m2", "visible": false } ]
],
"view": "timeSeries",
"stacked": false,
"region": "eu-west-1",
"period": 60,
"title": "Proportion of 4XX errors",
"stat": "Sum"
}
},
{
"height": 6,
"width": 12,
"y": 3,
"x": 12,
"type": "metric",
"properties": {
"metrics": [
[ { "expression": "100*(m1/m2)", "label": "Expression1", "id": "e1", "region": "eu-west-1" } ],
[ "AWS/ApiGateway", "5XXError", "ApiName", "$
{
apigw_name
}
", "Stage", "$
{
apigw_stage_name
}
", { "id": "m1", "visible": false } ],
[ ".", "Count", ".", ".", ".", ".", { "id": "m2", "visible": false } ]
],
"view": "timeSeries",
"stacked": false,
"region": "eu-west-1",
"period": 60,
"title": "Proportion of 5XX errors",
"stat": "Sum"
}
},
{
"height": 6,
"width": 12,
"y": 9,
"x": 0,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": [
[ "AWS/ApiGateway", "Count", "ApiName", "$
{
apigw_name
}
", "Stage", "$
{
apigw_stage_name
}
" ]
],
"region": "$
{
aws_region
}
",
"title":"Number of requests",
"period": 60,
"stat":"Sum"
}
},
{
"height": 6,
"width": 12,
"y": 18,
"x": 0,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": $
{
jsonencode
(
[
for
name
in
lambda_names
:
[
"AWS/Lambda"
,
"Throttles"
,
"FunctionName"
,
"${name}"
]
])
}
,
"region": "$
{
aws_region
}
",
"period": 60
}
},
{
"height": 6,
"width": 12,
"y": 18,
"x": 12,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": $
{
jsonencode
(
[
for
name
in
lambda_names
:
[
"AWS/Lambda"
,
"Invocations"
,
"FunctionName"
,
"${name}"
]
])
}
,
"region": "$
{
aws_region
}
",
"period": 60
}
},
{
"height": 6,
"width": 12,
"y": 24,
"x": 0,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": $
{
jsonencode
(
[
for
name
in
lambda_names
:
[
"LambdaInsights"
,
"memory_utilization"
,
"function_name"
,
"${name}"
]
])
}
,
"region": "$
{
aws_region
}
",
"period":60
}
},
{
"height": 6,
"width": 12,
"y": 33,
"x": 0,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": [
[ "AWS/DynamoDB", "ConsumedWriteCapacityUnits", "TableName", "$
{
dynamodb_table_name
}
" ],
[ ".", "ProvisionedWriteCapacityUnits", ".", "." ]
],
"region": "$
{
aws_region
}
",
"period":60
}
},
{
"height": 6,
"width": 12,
"y": 33,
"x": 12,
"type": "metric",
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": [
[ "AWS/DynamoDB", "ConsumedReadCapacityUnits", "TableName", "$
{
dynamodb_table_name
}
" ],
[ ".", "ProvisionedWriteCapacityUnits", ".", "." ]
],
"region": "$
{
aws_region
}
",
"period": 60
}
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment