-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DMVP-1232): Added container widgets for all requests, error rate…
…, health check
- Loading branch information
1 parent
824a1e8
commit b8654cf
Showing
19 changed files
with
553 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
modules/dashboard/modules/widgets/container/all-requests/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
No providers. | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
No resources. | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_cluster"></a> [cluster](#input\_cluster) | n/a | `string` | n/a | yes | | ||
| <a name="input_container"></a> [container](#input\_container) | n/a | `string` | n/a | yes | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_namespace"></a> [namespace](#input\_namespace) | n/a | `string` | `"default"` | no | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END_TF_DOCS --> | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_lb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb) | data source | | ||
| [aws_lb_target_group.target_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb_target_group) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_balancer_name"></a> [balancer\_name](#input\_balancer\_name) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
| <a name="input_target_group_arn"></a> [target\_group\_arn](#input\_target\_group\_arn) | n/a | `string` | `null` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
15 changes: 15 additions & 0 deletions
15
modules/dashboard/modules/widgets/container/all-requests/alb_target_group.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
data "aws_lb_target_group" "target_group" { | ||
count = var.target_group_arn == null ? 1 : 0 | ||
} | ||
|
||
data "aws_lb" "balancer" { | ||
count = var.balancer_arn == null ? 1 : 0 | ||
|
||
name = var.balancer_name | ||
} | ||
|
||
locals { | ||
balancer = split("loadbalancer/", var.balancer_arn == null ? data.aws_lb.balancer[0].arn : var.balancer_arn)[1] | ||
balancer_name = split("/", local.balancer)[1] | ||
target_group = "targetgroup/${split("targetgroup/", var.target_group_arn == null ? data.aws_lb_target_group.target_group[0].arn : var.target_group_arn)[1]}" | ||
} |
24 changes: 24 additions & 0 deletions
24
modules/dashboard/modules/widgets/container/all-requests/base.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "All Requests" | ||
|
||
stat = "Sum" | ||
|
||
defaults = { | ||
MetricNamespace = "AWS/ApplicationELB" | ||
LoadBalancer = local.balancer | ||
TargetGroup = local.target_group | ||
} | ||
|
||
period = var.period | ||
|
||
metrics = [ | ||
{ MetricName = "HTTPCode_Target_2XX_Count", color = "#3ECE76" }, | ||
{ MetricName = "HTTPCode_Target_3XX_Count", color = "#FFC300" }, | ||
{ MetricName = "HTTPCode_Target_4XX_Count", color = "#FF774D" }, | ||
{ MetricName = "HTTPCode_Target_5XX_Count", color = "#FF0F3C" }, | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/container/all-requests/output.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "data" { | ||
value = module.base.data | ||
} |
36 changes: 36 additions & 0 deletions
36
modules/dashboard/modules/widgets/container/all-requests/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
variable "target_group_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_name" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
# position | ||
variable "coordinates" { | ||
type = object({ | ||
x : number | ||
y : number | ||
width : number | ||
height : number | ||
}) | ||
} | ||
|
||
# stats | ||
variable "period" { | ||
type = number | ||
default = 300 | ||
} | ||
|
||
variable "anomaly_detection" { | ||
type = bool | ||
default = false | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
78 changes: 78 additions & 0 deletions
78
modules/dashboard/modules/widgets/container/error-rate/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
No providers. | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
No resources. | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_cluster"></a> [cluster](#input\_cluster) | n/a | `string` | n/a | yes | | ||
| <a name="input_container"></a> [container](#input\_container) | n/a | `string` | n/a | yes | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_namespace"></a> [namespace](#input\_namespace) | n/a | `string` | `"default"` | no | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END_TF_DOCS --> | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_lb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb) | data source | | ||
| [aws_lb_target_group.target_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb_target_group) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_balancer_name"></a> [balancer\_name](#input\_balancer\_name) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
| <a name="input_target_group_arn"></a> [target\_group\_arn](#input\_target\_group\_arn) | n/a | `string` | `null` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
15 changes: 15 additions & 0 deletions
15
modules/dashboard/modules/widgets/container/error-rate/alb_target_group.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
data "aws_lb_target_group" "target_group" { | ||
count = var.target_group_arn == null ? 1 : 0 | ||
} | ||
|
||
data "aws_lb" "balancer" { | ||
count = var.balancer_arn == null ? 1 : 0 | ||
|
||
name = var.balancer_name | ||
} | ||
|
||
locals { | ||
balancer = split("loadbalancer/", var.balancer_arn == null ? data.aws_lb.balancer[0].arn : var.balancer_arn)[1] | ||
balancer_name = split("/", local.balancer)[1] | ||
target_group = "targetgroup/${split("targetgroup/", var.target_group_arn == null ? data.aws_lb_target_group.target_group[0].arn : var.target_group_arn)[1]}" | ||
} |
30 changes: 30 additions & 0 deletions
30
modules/dashboard/modules/widgets/container/error-rate/base.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "Error Rate" | ||
|
||
stat = "Sum" | ||
|
||
defaults = { | ||
MetricNamespace = "AWS/ApplicationELB" | ||
LoadBalancer = local.balancer | ||
TargetGroup = local.target_group | ||
} | ||
|
||
period = var.period | ||
|
||
metrics = [ | ||
{ id = "m2", MetricName = "HTTPCode_Target_2XX_Count", visible = false }, | ||
{ id = "m5", MetricName = "HTTPCode_Target_5XX_Count", visible = false }, | ||
] | ||
|
||
expressions = [ | ||
{ | ||
expression = "m5/m2*100" | ||
label = "Percentage" | ||
color = "#FF103B" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/container/error-rate/output.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "data" { | ||
value = module.base.data | ||
} |
36 changes: 36 additions & 0 deletions
36
modules/dashboard/modules/widgets/container/error-rate/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
variable "target_group_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_name" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
# position | ||
variable "coordinates" { | ||
type = object({ | ||
x : number | ||
y : number | ||
width : number | ||
height : number | ||
}) | ||
} | ||
|
||
# stats | ||
variable "period" { | ||
type = number | ||
default = 300 | ||
} | ||
|
||
variable "anomaly_detection" { | ||
type = bool | ||
default = false | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
Oops, something went wrong.