Skip to content

Commit

Permalink
feat(DMVP-1232): Fixed required versions and some widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoryathegreat committed Nov 2, 2023
1 parent 2b898e5 commit 04ea271
Show file tree
Hide file tree
Showing 82 changed files with 167 additions and 186 deletions.
1 change: 1 addition & 0 deletions modules/dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
| <a name="module_widget_custom"></a> [widget\_custom](#module\_widget\_custom) | ./modules/widgets/custom | n/a |
| <a name="module_widget_dns_queries_chart"></a> [widget\_dns\_queries\_chart](#module\_widget\_dns\_queries\_chart) | ./modules/widgets/dns/queries-chart | n/a |
| <a name="module_widget_dns_queries_gauge"></a> [widget\_dns\_queries\_gauge](#module\_widget\_dns\_queries\_gauge) | ./modules/widgets/dns/queries-gauge | n/a |
| <a name="module_widget_log_based"></a> [widget\_log\_based](#module\_widget\_log\_based) | ./modules/widgets/log-based | n/a |
| <a name="module_widget_logs_insight_logs"></a> [widget\_logs\_insight\_logs](#module\_widget\_logs\_insight\_logs) | ./modules/widgets/logs-insight/logs | n/a |
| <a name="module_widget_logs_insight_metric"></a> [widget\_logs\_insight\_metric](#module\_widget\_logs\_insight\_metric) | ./modules/widgets/logs-insight/metric | n/a |
| <a name="module_widget_rds_cpu"></a> [widget\_rds\_cpu](#module\_widget\_rds\_cpu) | ./modules/widgets/rds/cpu | n/a |
Expand Down
4 changes: 2 additions & 2 deletions modules/dashboard/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {
namespace = "default"
width = 6
height = 6
anomaly_detection = true
anomaly_detection = false
expressions = []
yAxis = { left = { min = 0 } }
},
Expand Down Expand Up @@ -198,7 +198,7 @@ locals {
module.text_title_with_link[*].data,

# log based metrics
# module.widget_log_based[*].data,
module.widget_log_based[*].data,

# custom metrics
module.widget_custom[*].data,
Expand Down
1 change: 0 additions & 1 deletion modules/dashboard/modules/widgets/balancer/2xx/base.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ module "base" {
metrics = [
{ MetricName : "RequestCount" },
{ MetricName : "HTTPCode_Target_2XX_Count", "color" = "#2ca02c" },
# { MetricName : "HTTPCode_ELB_2XX_Count", "color" = "#98df8a" }
]
}
2 changes: 0 additions & 2 deletions modules/dashboard/modules/widgets/balancer/4xx/base.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ module "base" {
}

metrics = [
# { MetricName = "RequestCount" },
{ MetricName = "HTTPCode_Target_4XX_Count", "color" = "#ff7f0e" },
# { MetricName = "HTTPCode_ELB_4XX_Count", "color" = "#ffbb78" }
]
}
2 changes: 0 additions & 2 deletions modules/dashboard/modules/widgets/balancer/5xx/base.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ module "base" {
}

metrics = [
# { MetricName = "RequestCount" },
{ MetricName = "HTTPCode_Target_5XX_Count", "color" = "#d62728" },
# { MetricName = "HTTPCode_ELB_5XX_Count", "color" = "#ff9896" },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ No modules.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |

## Providers

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1.3"
}
2 changes: 1 addition & 1 deletion modules/dashboard/modules/widgets/container/cpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ No requirements.
| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No resources.
| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No resources.
| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No resources.
| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No resources.
| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ No resources.

| 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` | `true` | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ variable "period" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ No requirements.

| 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` | `true` | 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_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_data_source_uid"></a> [data\_source\_uid](#input\_data\_source\_uid) | The grafana dashboard widget item data source id | `string` | n/a | yes |
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ variable "zone_name" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}
11 changes: 6 additions & 5 deletions modules/dashboard/modules/widgets/log-based/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a |
| <a name="module_base"></a> [base](#module\_base) | ../base | n/a |

## Resources

Expand All @@ -57,13 +57,14 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no |
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Enables anomaly detection on widget metrics | `bool` | `false` | 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_namespace"></a> [namespace](#input\_namespace) | n/a | `string` | `"default"` | no |
| <a name="input_metrics"></a> [metrics](#input\_metrics) | n/a | `list(any)` | n/a | yes |
| <a name="input_period"></a> [period](#input\_period) | n/a | `number` | `300` | no |
| <a name="input_region"></a> [region](#input\_region) | region | `string` | `""` | no |
| <a name="input_stat"></a> [stat](#input\_stat) | stats | `string` | `"Average"` | no |
| <a name="input_stat"></a> [stat](#input\_stat) | stats | `string` | `null` | no |
| <a name="input_title"></a> [title](#input\_title) | n/a | `string` | n/a | yes |

## Outputs

Expand Down
17 changes: 10 additions & 7 deletions modules/dashboard/modules/widgets/log-based/base.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
module "base" {
source = "../../base"
source = "../base"

coordinates = var.coordinates

name = "Log Based / ${var.metric}"
name = var.title

defaults = {}
period = var.period

metrics = [
{ "ContainerInsights" : "pod_cpu_utilization", },
{ "ContainerInsights" : "pod_cpu_reserved_capacity", "Style" : { "color" : "#d62728" } }
]
defaults = {
MetricNamespace = "LogBasedMetrics${var.account_id == null ? "" : "/${var.account_id}"}"
accountId = var.account_id
anomaly_detection = var.anomaly_detection
}

metrics = var.metrics
}
30 changes: 21 additions & 9 deletions modules/dashboard/modules/widgets/log-based/variables.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
variable "container" {
variable "title" {
type = string
}

variable "cluster" {
type = string
}

variable "namespace" {
type = string
default = "default"
variable "metrics" {
type = list(any)
## sample form
# [
# { MetricName = "errors1", "ClusterName": "my-cluster-name" },
# { MetricName = "errors2", "color" = "#d62728" }
# { MetricName = "errors3", accountId = "12335657657657", "color" = "#d62728" }
# ]
}

# region
Expand All @@ -17,6 +18,11 @@ variable "region" {
default = ""
}

variable "account_id" {
type = string
default = null
}

# position
variable "coordinates" {
type = object({
Expand All @@ -30,10 +36,16 @@ variable "coordinates" {
# stats
variable "stat" {
type = string
default = "Average"
default = null
}

variable "period" {
type = number
default = 300
}

variable "anomaly_detection" {
type = bool
default = false
description = "Enables anomaly detection on widget metrics"
}
8 changes: 2 additions & 6 deletions modules/dashboard/modules/widgets/rds/cpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
No providers.

## Modules

Expand All @@ -58,9 +56,7 @@ No requirements.

## Resources

| Name | Type |
|------|------|
| [aws_caller_identity.project](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
No resources.

## Inputs

Expand Down
4 changes: 0 additions & 4 deletions modules/dashboard/modules/widgets/rds/cpu/base.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
data "aws_caller_identity" "project" {
provider = aws
}

module "base" {
source = "../../base"

Expand Down
10 changes: 3 additions & 7 deletions modules/dashboard/modules/widgets/rds/db-connections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
No providers.

## Modules

Expand All @@ -58,15 +56,13 @@ No requirements.

## Resources

| Name | Type |
|------|------|
| [aws_caller_identity.project](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
No resources.

## 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` | `true` | 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_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_data_source_uid"></a> [data\_source\_uid](#input\_data\_source\_uid) | The grafana dashboard widget item data source id | `string` | n/a | yes |
| <a name="input_db_max_connections_count"></a> [db\_max\_connections\_count](#input\_db\_max\_connections\_count) | RDS connection's maximum count | `number` | `null` | no |
Expand Down
4 changes: 0 additions & 4 deletions modules/dashboard/modules/widgets/rds/db-connections/base.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
data "aws_caller_identity" "project" {
provider = aws
}

module "base" {
source = "../../base"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ variable "rds_name" {

variable "anomaly_detection" {
type = bool
default = true
default = false
description = "Allow to enable anomaly detection on widget metrics"
}

Expand Down
8 changes: 2 additions & 6 deletions modules/dashboard/modules/widgets/rds/disk-latency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
No providers.

## Modules

Expand All @@ -58,9 +56,7 @@ No requirements.

## Resources

| Name | Type |
|------|------|
| [aws_caller_identity.project](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
No resources.

## Inputs

Expand Down
4 changes: 0 additions & 4 deletions modules/dashboard/modules/widgets/rds/disk-latency/base.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
data "aws_caller_identity" "project" {
provider = aws
}

module "base" {
source = "../../base"

Expand Down
Loading

0 comments on commit 04ea271

Please sign in to comment.