Skip to content

Commit

Permalink
Merge pull request #34 from telia-oss/add-cloudwatch-dashboard
Browse files Browse the repository at this point in the history
Add cloudwatch dashboard
  • Loading branch information
Kristian authored Aug 21, 2019
2 parents 38b0cef + 1e499a5 commit a3d26ed
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,16 @@ resource "aws_security_group_rule" "atc_ingress_postgres" {
to_port = module.postgres.port
source_security_group_id = module.concourse_atc.security_group_id
}

module "concourse_dashboard" {
source = "../../modules/dashboard"

name_prefix = var.name_prefix
atc_asg_name = module.concourse_atc.asg_id
atc_log_group_name = module.concourse_atc.log_group_name
worker_asg_name = module.concourse_worker.asg_id
worker_log_group_name = module.concourse_worker.log_group_name
internal_lb_arn = module.concourse_atc.internal_lb_arn
external_lb_arn = module.concourse_atc.external_lb_arn
rds_cluster_id = module.postgres.id
}
4 changes: 4 additions & 0 deletions modules/atc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ output "security_group_id" {
value = module.atc.security_group_id
}

output "log_group_name" {
value = aws_cloudwatch_log_group.atc.name
}

output "external_lb_arn" {
value = module.external_lb.arn
}
Expand Down
3 changes: 3 additions & 0 deletions modules/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Concourse Cloudwatch Dashboard

A cloudwatch dashboard for the Concourse deployment.
334 changes: 334 additions & 0 deletions modules/dashboard/dashboard.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
{
"widgets": [
{
"type": "metric",
"x": 0,
"y": 0,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/EC2",
"CPUUtilization",
"AutoScalingGroupName",
"${atc_asg_name}",
{
"label": "ATC"
}
],
[
"AWS/EC2",
"CPUUtilization",
"AutoScalingGroupName",
"${worker_asg_name}",
{
"label": "Worker"
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "CPU utilization",
"period": ${period}
}
},
{
"type": "metric",
"x": 6,
"y": 0,
"width": 6,
"height": 9,
"properties": {
"metrics": [],
"view": "timeSeries",
"region": "${region}",
"title": "PLACEHOLDER",
"period": ${period},
"stacked": false
}
},
{
"type": "metric",
"x": 12,
"y": 0,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/AutoScaling",
"GroupTotalInstances",
"AutoScalingGroupName",
"${atc_asg_name}",
{
"label": "ATC"
}
],
[
"AWS/AutoScaling",
"GroupTotalInstances",
"AutoScalingGroupName",
"${worker_asg_name}",
{
"label": "Worker"
}
]
],
"view": "timeSeries",
"region": "${region}",
"title": "Instance count",
"period": ${period},
"stacked": false
}
},
{
"type": "metric",
"x": 18,
"y": 0,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/Logs",
"IncomingLogEvents",
"LogGroupName",
"${atc_log_group_name}",
{
"label": "ATC"
}
],
[
"AWS/Logs",
"IncomingLogEvents",
"LogGroupName",
"${worker_log_group_name}",
{
"label": "Worker"
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "Log events (ATC/Worker)",
"period": ${period}
}
},
{
"type": "metric",
"x": 0,
"y": 9,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/EC2",
"NetworkIn",
"AutoScalingGroupName",
"${atc_asg_name}",
{
"label": "Inbound"
}
],
[
"AWS/EC2",
"NetworkOut",
"AutoScalingGroupName",
"${atc_asg_name}",
{
"label": "Outbound"
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "ATC network traffic (ENI in/out)",
"period": ${period}
}
},
{
"type": "metric",
"x": 6,
"y": 9,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/EC2",
"NetworkIn",
"AutoScalingGroupName",
"${worker_asg_name}",
{
"label": "Inbound"
}
],
[
"AWS/EC2",
"NetworkOut",
"AutoScalingGroupName",
"${worker_asg_name}",
{
"label": "Outbound"
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "Worker network traffic (ENI in/out)",
"period": ${period}
}
},
{
"type": "metric",
"x": 12,
"y": 9,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/ApplicationELB",
"ProcessedBytes",
"LoadBalancer",
"${external_lb}",
{
"label": "External ALB"
}
],
[
"AWS/NetworkELB",
"ProcessedBytes",
"LoadBalancer",
"${internal_lb}",
{
"label": "Internal NLB"
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"period": ${period},
"title": "Internal/external LB (processed bytes)"
}
},
{
"type": "metric",
"x": 18,
"y": 9,
"width": 6,
"height": 9,
"properties": {
"metrics": [
%{ if length(nat_gateway_metrics) > 0 }
[
{
"expression": "SUM(${jsonencode(nat_inbound_ids)})",
"label": "Inbound",
"id": "inbound"
}
],
[
{
"expression": "SUM(${jsonencode(nat_outbound_ids)})",
"label": "Outbound",
"id": "outbound"
}
],
${jsonencode(nat_gateway_metrics)}
%{ endif }
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "NAT Gateway (in/out)",
"period": ${period}
}
%{ if rds_cluster_id == "" }
}
%{ else }
},
{
"type": "metric",
"x": 0,
"y": 18,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/RDS",
"DatabaseConnections",
"DBClusterIdentifier",
"${rds_cluster_id}",
{
"stat": "Maximum",
"period": ${period}
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "RDS Database connections (max)"
}
},
{
"type": "metric",
"x": 6,
"y": 18,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/RDS",
"CPUUtilization",
"DBClusterIdentifier",
"${rds_cluster_id}",
{
"period": ${period}
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "RDS CPU Utilisation"
}
},
{
"type": "metric",
"x": 12,
"y": 18,
"width": 6,
"height": 9,
"properties": {
"metrics": [
[
"AWS/RDS",
"FreeableMemory",
"DBClusterIdentifier",
"${rds_cluster_id}",
{
"stat": "Minimum",
"period": ${period}
}
]
],
"view": "timeSeries",
"stacked": false,
"region": "${region}",
"title": "RDS Freeable memory (min)"
}
}
%{ endif }
]
}
Loading

0 comments on commit a3d26ed

Please sign in to comment.