From 935b81c5aa2a8cc461898b5ddc553f5dc7e48d26 Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Tue, 7 Nov 2023 14:12:41 +0400 Subject: [PATCH 1/8] fix(fix-bugs): fix monitoring bugs --- modules/dashboard/README.md | 2 +- modules/dashboard/blocks.tf | 2 +- modules/dashboard/tests/widgets-log-based/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/dashboard/README.md b/modules/dashboard/README.md index b2fd7f0..9af821a 100644 --- a/modules/dashboard/README.md +++ b/modules/dashboard/README.md @@ -118,7 +118,7 @@ module "this" { | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.3 | +| [aws](#provider\_aws) | 4.38.0 | ## Modules diff --git a/modules/dashboard/blocks.tf b/modules/dashboard/blocks.tf index 3762acc..2f8d659 100644 --- a/modules/dashboard/blocks.tf +++ b/modules/dashboard/blocks.tf @@ -98,6 +98,6 @@ module "block_sla" { count = length(local.blocks_by_type.sla) - balancer_name = local.blocks_by_type.service[count.index].block.balancer_name + balancer_name = local.blocks_by_type.sla[count.index].block.balancer_name region = var.region != "" ? var.region : data.aws_region.current.name } diff --git a/modules/dashboard/tests/widgets-log-based/README.md b/modules/dashboard/tests/widgets-log-based/README.md index 1156a59..aca55ce 100644 --- a/modules/dashboard/tests/widgets-log-based/README.md +++ b/modules/dashboard/tests/widgets-log-based/README.md @@ -10,7 +10,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 4.67.0 | +| [aws](#provider\_aws) | ~> 4.33 | | [test](#provider\_test) | n/a | ## Modules From 85c5965367c30fa47bbd320ff9d3d2e3da5e0047 Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Tue, 7 Nov 2023 14:13:06 +0400 Subject: [PATCH 2/8] fix(fix-bugs): fix monitoring bugs --- modules/alerts/tests/expression-alert/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/alerts/tests/expression-alert/README.md b/modules/alerts/tests/expression-alert/README.md index 86f8db2..dbc7698 100644 --- a/modules/alerts/tests/expression-alert/README.md +++ b/modules/alerts/tests/expression-alert/README.md @@ -11,7 +11,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.33 | +| [aws](#provider\_aws) | 4.67.0 | | [test](#provider\_test) | n/a | ## Modules From 9a6d6b9bfafb6e9386624a3eba86e7a25f44756c Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Tue, 7 Nov 2023 15:23:11 +0400 Subject: [PATCH 3/8] fix(fix-bugs): fix monitoring bugs --- modules/dashboard/modules/blocks/service/output.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dashboard/modules/blocks/service/output.tf b/modules/dashboard/modules/blocks/service/output.tf index 7928a1e..793af3d 100644 --- a/modules/dashboard/modules/blocks/service/output.tf +++ b/modules/dashboard/modules/blocks/service/output.tf @@ -2,7 +2,7 @@ output "result" { description = "description" value = [ [ - { type : "text/title", text : "Superset" } + { type : "text/title", text : var.service_name } ], [ { type : "container/request-count", container : var.service_name, target_group_arn : var.target_group_arn, cluster : var.cluster }, From 73d829f0ac7e5feb5dec3088e4eb6db603b62d9b Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Thu, 9 Nov 2023 11:37:29 +0400 Subject: [PATCH 4/8] fix(fix-bugs): Fix dashboard --- modules/dashboard/blocks.tf | 7 ++-- .../dashboard/modules/blocks/alb/output.tf | 6 +-- .../modules/blocks/service/README.md | 1 + .../modules/blocks/service/output.tf | 40 +++++++++++++------ .../modules/blocks/service/variables.tf | 5 +++ .../modules/widgets/sla-slo-sli/base.tf | 2 +- .../widgets/text/title-with-link/README.md | 1 + .../widgets/text/title-with-link/local.tf | 2 +- .../widgets/text/title-with-link/variables.tf | 5 +++ 9 files changed, 48 insertions(+), 21 deletions(-) diff --git a/modules/dashboard/blocks.tf b/modules/dashboard/blocks.tf index 2f8d659..79bf62a 100644 --- a/modules/dashboard/blocks.tf +++ b/modules/dashboard/blocks.tf @@ -86,10 +86,11 @@ module "block_service" { count = length(local.blocks_by_type.service) service_name = local.blocks_by_type.service[count.index].block.service_name - balancer_name = local.blocks_by_type.service[count.index].block.balancer_name - target_group_arn = local.blocks_by_type.service[count.index].block.target_group_arn - healthcheck_id = local.blocks_by_type.service[count.index].block.healthcheck_id + balancer_name = try(local.blocks_by_type.service[count.index].block.balancer_name, null) + target_group_arn = try(local.blocks_by_type.service[count.index].block.target_group_arn, null) + healthcheck_id = try(local.blocks_by_type.service[count.index].block.healthcheck_id, null) cluster = local.blocks_by_type.service[count.index].block.cluster + namespace = try(local.blocks_by_type.service[count.index].block.namespace, "default") region = var.region != "" ? var.region : data.aws_region.current.name } diff --git a/modules/dashboard/modules/blocks/alb/output.tf b/modules/dashboard/modules/blocks/alb/output.tf index e01794b..9b62483 100644 --- a/modules/dashboard/modules/blocks/alb/output.tf +++ b/modules/dashboard/modules/blocks/alb/output.tf @@ -6,7 +6,7 @@ output "result" { description = "description" value = [ [ - { type : "text/title-with-link", text : "Load Balancer (ALB)", link_to_jump = "https://${var.region}.console.aws.amazon.com/ec2/home?region=${var.region}#LoadBalancer:loadBalancerArn=${data.aws_lb.balancer.arn};tab=listeners" } + { type : "text/title-with-link", text : "Load Balancer (${var.balancer_name})", link_to_jump = "https://${var.region}.console.aws.amazon.com/ec2/home?region=${var.region}#LoadBalancer:loadBalancerArn=${data.aws_lb.balancer.arn};tab=listeners" } ], [ { type : "balancer/request-count", accountId : var.account_id, balancer_name : var.balancer_name, anomaly_detection : false }, @@ -21,8 +21,8 @@ output "result" { { type : "balancer/connection-issues", accountId : var.account_id, balancer_name : var.balancer_name, anomaly_detection = false }, ], [ - { type : "balancer/response-time", accountId : var.account_id, balancer_name : var.balancer_name }, - { type : "balancer/traffic", accountId : var.account_id, balancer_name : var.balancer_name }, + { type : "balancer/response-time", accountId : var.account_id, balancer_name : var.balancer_name, width : 12 }, + { type : "balancer/traffic", accountId : var.account_id, balancer_name : var.balancer_name, width : 12 }, ], ] } diff --git a/modules/dashboard/modules/blocks/service/README.md b/modules/dashboard/modules/blocks/service/README.md index 35f7272..81f8fad 100644 --- a/modules/dashboard/modules/blocks/service/README.md +++ b/modules/dashboard/modules/blocks/service/README.md @@ -24,6 +24,7 @@ No resources. | [balancer\_name](#input\_balancer\_name) | ALB name | `string` | n/a | yes | | [cluster](#input\_cluster) | EKS cluster name | `string` | n/a | yes | | [healthcheck\_id](#input\_healthcheck\_id) | R53 healthcheck ID for the service | `string` | n/a | yes | +| [namespace](#input\_namespace) | EKS namespace name | `string` | n/a | yes | | [region](#input\_region) | n/a | `string` | `""` | no | | [service\_name](#input\_service\_name) | Service nameD | `string` | n/a | yes | | [target\_group\_arn](#input\_target\_group\_arn) | Target group ARN which points to the service | `string` | n/a | yes | diff --git a/modules/dashboard/modules/blocks/service/output.tf b/modules/dashboard/modules/blocks/service/output.tf index 793af3d..9f8fbd8 100644 --- a/modules/dashboard/modules/blocks/service/output.tf +++ b/modules/dashboard/modules/blocks/service/output.tf @@ -1,27 +1,41 @@ output "result" { description = "description" - value = [ + value = var.balancer_name != null ? [ [ { type : "text/title", text : var.service_name } ], [ - { type : "container/request-count", container : var.service_name, target_group_arn : var.target_group_arn, cluster : var.cluster }, - { type : "container/all-requests", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster }, - { type : "container/error-rate", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster }, - { type : "container/health-check", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster }, + { type : "container/request-count", container : var.service_name, target_group_arn : var.target_group_arn, cluster : var.cluster, namespace : var.namespace }, + { type : "container/all-requests", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/error-rate", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/health-check", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster, namespace : var.namespace }, ], [ - { type : "container/cpu", container : var.service_name, cluster : var.cluster }, - { type : "container/memory", container : var.service_name, cluster : var.cluster }, - { type : "container/network-in", container : var.service_name, cluster : var.cluster }, - { type : "container/network-out", container : var.service_name, cluster : var.cluster }, + { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, ], [ - { type : "container/external-health-check", container : var.service_name, healthcheck_id : var.healthcheck_id, cluster : var.cluster }, - { type : "container/replicas", container : var.service_name, cluster : var.cluster }, - { type : "container/restarts", container : var.service_name, cluster : var.cluster }, - { type : "container/response-time", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster }, + { type : "container/external-health-check", container : var.service_name, healthcheck_id : var.healthcheck_id, cluster : var.cluster, namespace : var.namespace }, + { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/response-time", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster, namespace : var.namespace }, # { type : "container/network", container : local.container_1 }, ], + ] : [ + [ + { type : "text/title", text : var.service_name } + ], + [ + { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + ], + [ + { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + ] ] } diff --git a/modules/dashboard/modules/blocks/service/variables.tf b/modules/dashboard/modules/blocks/service/variables.tf index 6da696b..8af0d15 100644 --- a/modules/dashboard/modules/blocks/service/variables.tf +++ b/modules/dashboard/modules/blocks/service/variables.tf @@ -23,6 +23,11 @@ variable "cluster" { description = "EKS cluster name" } +variable "namespace" { + type = string + description = "EKS namespace name" +} + variable "region" { type = string default = "" diff --git a/modules/dashboard/modules/widgets/sla-slo-sli/base.tf b/modules/dashboard/modules/widgets/sla-slo-sli/base.tf index 5f62cad..1959c83 100644 --- a/modules/dashboard/modules/widgets/sla-slo-sli/base.tf +++ b/modules/dashboard/modules/widgets/sla-slo-sli/base.tf @@ -3,7 +3,7 @@ module "base" { coordinates = var.coordinates - name = "SLA" + name = var.balancer_name != null ? "${var.balancer_name} SLA" : "SLA" # stats stat = "Sum" diff --git a/modules/dashboard/modules/widgets/text/title-with-link/README.md b/modules/dashboard/modules/widgets/text/title-with-link/README.md index 7fe76ec..0fccc49 100644 --- a/modules/dashboard/modules/widgets/text/title-with-link/README.md +++ b/modules/dashboard/modules/widgets/text/title-with-link/README.md @@ -51,6 +51,7 @@ No resources. |------|-------------|------|---------|:--------:| | [link\_to\_jump](#input\_link\_to\_jump) | The URL to wich the user can be redirected after clicking on the title | `string` | n/a | yes | | [text](#input\_text) | n/a | `string` | n/a | yes | +| [width](#input\_width) | n/a | `number` | `24` | no | | [y](#input\_y) | n/a | `number` | n/a | yes | ## Outputs diff --git a/modules/dashboard/modules/widgets/text/title-with-link/local.tf b/modules/dashboard/modules/widgets/text/title-with-link/local.tf index 66cf7b0..177d41f 100644 --- a/modules/dashboard/modules/widgets/text/title-with-link/local.tf +++ b/modules/dashboard/modules/widgets/text/title-with-link/local.tf @@ -3,7 +3,7 @@ locals { "type" : "text", "x" : 0, "y" : var.y, - "width" : 24, + "width" : var.width, "height" : 1, "properties" : { diff --git a/modules/dashboard/modules/widgets/text/title-with-link/variables.tf b/modules/dashboard/modules/widgets/text/title-with-link/variables.tf index 46b0460..9f35840 100644 --- a/modules/dashboard/modules/widgets/text/title-with-link/variables.tf +++ b/modules/dashboard/modules/widgets/text/title-with-link/variables.tf @@ -10,3 +10,8 @@ variable "link_to_jump" { variable "y" { type = number } + +variable "width" { + type = number + default = 24 +} From 4b35202d6a5d298056464309dc4db2c94a86a3f3 Mon Sep 17 00:00:00 2001 From: "Karapetyan, Aram" Date: Thu, 9 Nov 2023 11:54:18 +0400 Subject: [PATCH 5/8] feat(DMVP-2740): add markdown widget to add contextual info later --- .../alerts/tests/expression-alert/README.md | 2 +- modules/dashboard/README.md | 2 +- .../modules/blocks/service/output.tf | 4 +- .../modules/widgets/text/markdown/README.md | 76 +++++++++++++++++++ .../modules/widgets/text/markdown/local.tf | 14 ++++ .../modules/widgets/text/markdown/output.tf | 3 + .../widgets/text/markdown/variables.tf | 17 +++++ 7 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 modules/dashboard/modules/widgets/text/markdown/README.md create mode 100644 modules/dashboard/modules/widgets/text/markdown/local.tf create mode 100644 modules/dashboard/modules/widgets/text/markdown/output.tf create mode 100644 modules/dashboard/modules/widgets/text/markdown/variables.tf diff --git a/modules/alerts/tests/expression-alert/README.md b/modules/alerts/tests/expression-alert/README.md index dbc7698..86f8db2 100644 --- a/modules/alerts/tests/expression-alert/README.md +++ b/modules/alerts/tests/expression-alert/README.md @@ -11,7 +11,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 4.67.0 | +| [aws](#provider\_aws) | ~> 4.33 | | [test](#provider\_test) | n/a | ## Modules diff --git a/modules/dashboard/README.md b/modules/dashboard/README.md index 9af821a..b2fd7f0 100644 --- a/modules/dashboard/README.md +++ b/modules/dashboard/README.md @@ -118,7 +118,7 @@ module "this" { | Name | Version | |------|---------| -| [aws](#provider\_aws) | 4.38.0 | +| [aws](#provider\_aws) | ~> 4.3 | ## Modules diff --git a/modules/dashboard/modules/blocks/service/output.tf b/modules/dashboard/modules/blocks/service/output.tf index 9f8fbd8..39667c0 100644 --- a/modules/dashboard/modules/blocks/service/output.tf +++ b/modules/dashboard/modules/blocks/service/output.tf @@ -34,8 +34,8 @@ output "result" { { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, ], [ - { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12 }, + { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12 }, ] ] } diff --git a/modules/dashboard/modules/widgets/text/markdown/README.md b/modules/dashboard/modules/widgets/text/markdown/README.md new file mode 100644 index 0000000..8d7b0cc --- /dev/null +++ b/modules/dashboard/modules/widgets/text/markdown/README.md @@ -0,0 +1,76 @@ +# Why +Widget to render markdown text. + +``` +{ + text: "Whatever text has to go here", + coordinates: { + x: 4 + y: 10 + width: 4 + height: 4 + } +} +``` + + +## Requirements + +No requirements. + +## Providers + +No providers. + +## Modules + +No modules. + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [text](#input\_text) | n/a | `string` | n/a | yes | +| [y](#input\_y) | n/a | `number` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [data](#output\_data) | n/a | + + +## Requirements + +No requirements. + +## Providers + +No providers. + +## Modules + +No modules. + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [coordinates](#input\_coordinates) | n/a |
object({
x : number
y : number
width : number
height : number
})
| n/a | yes | +| [text](#input\_text) | n/a | `string` | n/a | yes | +| [transparent-background](#input\_transparent-background) | n/a | `bool` | `true` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [data](#output\_data) | n/a | + diff --git a/modules/dashboard/modules/widgets/text/markdown/local.tf b/modules/dashboard/modules/widgets/text/markdown/local.tf new file mode 100644 index 0000000..ca337ac --- /dev/null +++ b/modules/dashboard/modules/widgets/text/markdown/local.tf @@ -0,0 +1,14 @@ +locals { + data = { + "type" : "text", + "x" : var.coordinates.x, + "y" : var.coordinates.y, + "width" : var.coordinates.width, + "height" : var.coordinates.height, + + "properties" : { + "markdown" : "${var.text}" + "background" : var.transparent-background ? "transparent" : "" + } + } +} diff --git a/modules/dashboard/modules/widgets/text/markdown/output.tf b/modules/dashboard/modules/widgets/text/markdown/output.tf new file mode 100644 index 0000000..b140c6e --- /dev/null +++ b/modules/dashboard/modules/widgets/text/markdown/output.tf @@ -0,0 +1,3 @@ +output "data" { + value = local.data +} diff --git a/modules/dashboard/modules/widgets/text/markdown/variables.tf b/modules/dashboard/modules/widgets/text/markdown/variables.tf new file mode 100644 index 0000000..fdf06c4 --- /dev/null +++ b/modules/dashboard/modules/widgets/text/markdown/variables.tf @@ -0,0 +1,17 @@ +variable "text" { + type = string +} + +variable "coordinates" { + type = object({ + x : number + y : number + width : number + height : number + }) +} + +variable "transparent-background" { + type = bool + default = true +} From 315aabfe50c6c85d4426677ef71c9461a5dde91b Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Fri, 10 Nov 2023 13:15:14 +0400 Subject: [PATCH 6/8] fix(DMVP-fix-bugs): Delete check --- modules/dashboard/README.md | 2 +- modules/dashboard/modules/widgets/sla-slo-sli/base.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dashboard/README.md b/modules/dashboard/README.md index b2fd7f0..9af821a 100644 --- a/modules/dashboard/README.md +++ b/modules/dashboard/README.md @@ -118,7 +118,7 @@ module "this" { | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.3 | +| [aws](#provider\_aws) | 4.38.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/sla-slo-sli/base.tf b/modules/dashboard/modules/widgets/sla-slo-sli/base.tf index 1959c83..7a1e4c1 100644 --- a/modules/dashboard/modules/widgets/sla-slo-sli/base.tf +++ b/modules/dashboard/modules/widgets/sla-slo-sli/base.tf @@ -3,7 +3,7 @@ module "base" { coordinates = var.coordinates - name = var.balancer_name != null ? "${var.balancer_name} SLA" : "SLA" + name = "${var.balancer_name} SLA" # stats stat = "Sum" From 74a27c3e17abc542381daeab05712c0025b43841 Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Fri, 10 Nov 2023 13:55:11 +0400 Subject: [PATCH 7/8] fix(fix-bugs): Added annomaly --- .../dashboard/modules/blocks/alb/output.tf | 4 ++-- .../modules/blocks/service/output.tf | 20 +++++++++---------- .../dashboard/modules/widgets/base/README.md | 2 +- .../modules/widgets/base/variables.tf | 2 +- .../widgets/dns/queries-chart/README.md | 2 +- .../widgets/dns/queries-chart/variables.tf | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/dashboard/modules/blocks/alb/output.tf b/modules/dashboard/modules/blocks/alb/output.tf index 9b62483..2590b24 100644 --- a/modules/dashboard/modules/blocks/alb/output.tf +++ b/modules/dashboard/modules/blocks/alb/output.tf @@ -21,8 +21,8 @@ output "result" { { type : "balancer/connection-issues", accountId : var.account_id, balancer_name : var.balancer_name, anomaly_detection = false }, ], [ - { type : "balancer/response-time", accountId : var.account_id, balancer_name : var.balancer_name, width : 12 }, - { type : "balancer/traffic", accountId : var.account_id, balancer_name : var.balancer_name, width : 12 }, + { type : "balancer/response-time", accountId : var.account_id, balancer_name : var.balancer_name, width : 12, anomaly_detection = true }, + { type : "balancer/traffic", accountId : var.account_id, balancer_name : var.balancer_name, width : 12, anomaly_detection = true }, ], ] } diff --git a/modules/dashboard/modules/blocks/service/output.tf b/modules/dashboard/modules/blocks/service/output.tf index 39667c0..572dc75 100644 --- a/modules/dashboard/modules/blocks/service/output.tf +++ b/modules/dashboard/modules/blocks/service/output.tf @@ -11,10 +11,10 @@ output "result" { { type : "container/health-check", container : var.service_name, target_group_arn : var.target_group_arn, balancer_name : var.balancer_name, cluster : var.cluster, namespace : var.namespace }, ], [ - { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, + { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, + { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, + { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, ], [ { type : "container/external-health-check", container : var.service_name, healthcheck_id : var.healthcheck_id, cluster : var.cluster, namespace : var.namespace }, @@ -28,14 +28,14 @@ output "result" { { type : "text/title", text : var.service_name } ], [ - { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, - { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/cpu", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, + { type : "container/memory", container : var.service_name, cluster : var.cluster, namespace : var.namespace, anomaly_detection : true }, + { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, + { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace }, ], [ - { type : "container/replicas", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12 }, - { type : "container/restarts", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12 }, + { type : "container/network-in", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12, anomaly_detection : true }, + { type : "container/network-out", container : var.service_name, cluster : var.cluster, namespace : var.namespace, width : 12, anomaly_detection : true }, ] ] } diff --git a/modules/dashboard/modules/widgets/base/README.md b/modules/dashboard/modules/widgets/base/README.md index cbd5608..36acdd8 100644 --- a/modules/dashboard/modules/widgets/base/README.md +++ b/modules/dashboard/modules/widgets/base/README.md @@ -95,7 +95,7 @@ No requirements. | [trend](#input\_trend) | trend of widget | `bool` | `null` | no | | [type](#input\_type) | The type of widget to be prepared | `string` | `"metric"` | no | | [view](#input\_view) | The view for log insights and alarm widgets | `string` | `null` | no | -| [yAxis](#input\_yAxis) | Widget Item common yAxis option (applied only metric type widgets). | `any` |
{
"left": {
"min": 0
}
}
| no | +| [yAxis](#input\_yAxis) | Widget Item common yAxis option (applied only metric type widgets). | `any` |
{
"left": {}
}
| no | ## Outputs diff --git a/modules/dashboard/modules/widgets/base/variables.tf b/modules/dashboard/modules/widgets/base/variables.tf index dcfab6d..b7803a8 100644 --- a/modules/dashboard/modules/widgets/base/variables.tf +++ b/modules/dashboard/modules/widgets/base/variables.tf @@ -121,7 +121,7 @@ variable "properties_type" { variable "yAxis" { type = any - default = { left = { min = 0 } } + default = { left = {} } //min = 0 } } description = "Widget Item common yAxis option (applied only metric type widgets)." } diff --git a/modules/dashboard/modules/widgets/dns/queries-chart/README.md b/modules/dashboard/modules/widgets/dns/queries-chart/README.md index ea20ace..780f70b 100644 --- a/modules/dashboard/modules/widgets/dns/queries-chart/README.md +++ b/modules/dashboard/modules/widgets/dns/queries-chart/README.md @@ -67,7 +67,7 @@ No requirements. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | +| [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `true` | no | | [coordinates](#input\_coordinates) | position |
object({
x : number
y : number
width : number
height : number
})
| n/a | yes | | [data\_source\_uid](#input\_data\_source\_uid) | The grafana dashboard widget item data source id | `string` | n/a | yes | | [period](#input\_period) | stats | `number` | `300` | no | diff --git a/modules/dashboard/modules/widgets/dns/queries-chart/variables.tf b/modules/dashboard/modules/widgets/dns/queries-chart/variables.tf index 59f71d4..1251a36 100644 --- a/modules/dashboard/modules/widgets/dns/queries-chart/variables.tf +++ b/modules/dashboard/modules/widgets/dns/queries-chart/variables.tf @@ -33,6 +33,6 @@ variable "zone_name" { variable "anomaly_detection" { type = bool - default = false + default = true description = "Allow to enable anomaly detection on widget metrics" } From 0d0cc7a918d3a5278c884f77c5b6c32d6936d9df Mon Sep 17 00:00:00 2001 From: Julia Aghamyan Date: Fri, 10 Nov 2023 14:03:12 +0400 Subject: [PATCH 8/8] fix(fix-bugs): Added annomaly --- modules/dashboard/modules/widgets/base/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dashboard/modules/widgets/base/variables.tf b/modules/dashboard/modules/widgets/base/variables.tf index b7803a8..51c7cb2 100644 --- a/modules/dashboard/modules/widgets/base/variables.tf +++ b/modules/dashboard/modules/widgets/base/variables.tf @@ -121,7 +121,7 @@ variable "properties_type" { variable "yAxis" { type = any - default = { left = {} } //min = 0 } } + default = { left = {} } description = "Widget Item common yAxis option (applied only metric type widgets)." }