-
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.
fix: adjust network widget and add two additional for in and out
- Loading branch information
1 parent
1f2e51c
commit 121c1b1
Showing
15 changed files
with
424 additions
and
58 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
76 changes: 76 additions & 0 deletions
76
modules/dashboard/modules/widgets/container/network-in/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,76 @@ | ||
<!-- 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 | ||
|
||
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` | `true` | 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_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_namespace"></a> [namespace](#input\_namespace) | n/a | `string` | `"default"` | no | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
| <a name="input_platform"></a> [platform](#input\_platform) | The platform/service/adapter to create dashboard on. for now only cloudwatch and grafana supported | `string` | `"cloudwatch"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
25 changes: 25 additions & 0 deletions
25
modules/dashboard/modules/widgets/container/network-in/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,25 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
platform = var.platform | ||
data_source_uid = var.data_source_uid | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "Network < In" | ||
|
||
defaults = { | ||
MetricNamespace = "ContainerInsights" | ||
ClusterName = var.cluster | ||
Namespace = var.namespace | ||
PodName = var.container | ||
accountId = var.account_id | ||
anomaly_detection = var.anomaly_detection | ||
} | ||
|
||
period = var.period | ||
|
||
metrics = [ | ||
{ MetricName = "pod_network_rx_bytes", color = "#17becf", label = "In", anomaly_detection = var.anomaly_detection }, | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/container/network-in/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 | ||
} |
50 changes: 50 additions & 0 deletions
50
modules/dashboard/modules/widgets/container/network-in/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,50 @@ | ||
variable "platform" { | ||
type = string | ||
default = "cloudwatch" | ||
description = "The platform/service/adapter to create dashboard on. for now only cloudwatch and grafana supported" | ||
} | ||
|
||
variable "data_source_uid" { | ||
type = string | ||
description = "The grafana dashboard widget item data source id" | ||
} | ||
|
||
variable "container" { | ||
type = string | ||
} | ||
|
||
variable "cluster" { | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
type = string | ||
default = "default" | ||
} | ||
|
||
variable "account_id" { | ||
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 = true | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
76 changes: 76 additions & 0 deletions
76
modules/dashboard/modules/widgets/container/network-out/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,76 @@ | ||
<!-- 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 | ||
|
||
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` | `true` | 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_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_namespace"></a> [namespace](#input\_namespace) | n/a | `string` | `"default"` | no | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
| <a name="input_platform"></a> [platform](#input\_platform) | The platform/service/adapter to create dashboard on. for now only cloudwatch and grafana supported | `string` | `"cloudwatch"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
25 changes: 25 additions & 0 deletions
25
modules/dashboard/modules/widgets/container/network-out/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,25 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
platform = var.platform | ||
data_source_uid = var.data_source_uid | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "Network > Out" | ||
|
||
defaults = { | ||
MetricNamespace = "ContainerInsights" | ||
ClusterName = var.cluster | ||
Namespace = var.namespace | ||
PodName = var.container | ||
accountId = var.account_id | ||
anomaly_detection = var.anomaly_detection | ||
} | ||
|
||
period = var.period | ||
|
||
metrics = [ | ||
{ MetricName = "pod_network_tx_bytes", color = "#e377c2", label = "Out", anomaly_detection = var.anomaly_detection } | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/container/network-out/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 | ||
} |
50 changes: 50 additions & 0 deletions
50
modules/dashboard/modules/widgets/container/network-out/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,50 @@ | ||
variable "platform" { | ||
type = string | ||
default = "cloudwatch" | ||
description = "The platform/service/adapter to create dashboard on. for now only cloudwatch and grafana supported" | ||
} | ||
|
||
variable "data_source_uid" { | ||
type = string | ||
description = "The grafana dashboard widget item data source id" | ||
} | ||
|
||
variable "container" { | ||
type = string | ||
} | ||
|
||
variable "cluster" { | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
type = string | ||
default = "default" | ||
} | ||
|
||
variable "account_id" { | ||
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 = true | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
Oops, something went wrong.