From 8ff94a6cd6c1c9b253453746a644c2e160aca865 Mon Sep 17 00:00:00 2001 From: Aram Karapetyan Date: Fri, 26 Jan 2024 10:22:18 +0400 Subject: [PATCH 1/4] fix(DMVP-3391): Add memory limiter mib limit --- examples/spot-instance/README.md | 2 +- modules/adot/templates/adot-values.yaml.tpl | 4 ++-- modules/adot/tests/template_file/README.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/spot-instance/README.md b/examples/spot-instance/README.md index 41252e4..0bb326b 100644 --- a/examples/spot-instance/README.md +++ b/examples/spot-instance/README.md @@ -12,7 +12,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.41 | +| [aws](#provider\_aws) | 4.67.0 | ## Modules diff --git a/modules/adot/templates/adot-values.yaml.tpl b/modules/adot/templates/adot-values.yaml.tpl index cd0e1d0..c9d7724 100644 --- a/modules/adot/templates/adot-values.yaml.tpl +++ b/modules/adot/templates/adot-values.yaml.tpl @@ -128,8 +128,8 @@ adotCollector: timeout: 30s send_batch_size: 8192 memory_limiter: - limit_mib: 100 - check_interval: 5s + limit_mib: 4000 + check_interval: 1s exporters: awsemf/prometheus: dimension_rollup_option: NoDimensionRollup diff --git a/modules/adot/tests/template_file/README.md b/modules/adot/tests/template_file/README.md index b00238f..466a3ea 100644 --- a/modules/adot/tests/template_file/README.md +++ b/modules/adot/tests/template_file/README.md @@ -15,8 +15,8 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.41 | -| [helm](#provider\_helm) | >= 2.0 | +| [aws](#provider\_aws) | 4.63.0 | +| [helm](#provider\_helm) | 2.9.0 | | [test](#provider\_test) | n/a | ## Modules From 1a3f6679d05a78b9c31ef7590b9e2ad8c79c3436 Mon Sep 17 00:00:00 2001 From: Aram Karapetyan Date: Fri, 26 Jan 2024 11:21:18 +0400 Subject: [PATCH 2/4] fix(DMVP-3391): Add memory limiter mib limit --- modules/adot/README.md | 2 +- modules/adot/main.tf | 2 ++ modules/adot/variables.tf | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/adot/README.md b/modules/adot/README.md index 539b583..0506806 100644 --- a/modules/adot/README.md +++ b/modules/adot/README.md @@ -75,7 +75,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [adot\_collector\_policy\_arns](#input\_adot\_collector\_policy\_arns) | List of IAM policy ARNs to attach to the ADOT collector service account. | `list(string)` | `[]` | no | -| [adot\_config](#input\_adot\_config) | accept\_namespace\_regex defines the list of namespaces from which metrics will be exported, and additional\_metrics defines additional metrics to export. |
object({
accept_namespace_regex = optional(string, "(default|kube-system)")
additional_metrics = optional(list(string), [])
log_group_name = optional(string, "adot")
log_retention = optional(number, 14)
helm_values = optional(any, null)
logging_enable = optional(bool, false)
resources = optional(object({
limit = object({
cpu = optional(string, "200m")
memory = optional(string, "200Mi")
})
requests = object({
cpu = optional(string, "200m")
memory = optional(string, "200Mi")
})
}), {
limit = {
cpu = "200m"
memory = "200Mi"
}
requests = {
cpu = "200m"
memory = "200Mi"
} })
})
|
{
"accept_namespace_regex": "(default|kube-system)",
"additional_metrics": [],
"helm_values": null,
"log_group_name": "adot",
"log_retention": 14,
"logging_enable": false,
"resources": {
"limit": {
"cpu": "200m",
"memory": "200Mi"
},
"requests": {
"cpu": "200m",
"memory": "200Mi"
}
}
}
| no | +| [adot\_config](#input\_adot\_config) | accept\_namespace\_regex defines the list of namespaces from which metrics will be exported, and additional\_metrics defines additional metrics to export. |
object({
accept_namespace_regex = optional(string, "(default|kube-system)")
additional_metrics = optional(list(string), [])
log_group_name = optional(string, "adot")
log_retention = optional(number, 14)
helm_values = optional(any, null)
logging_enable = optional(bool, false)
memory_limiter = optional(object(
{
limit_mib = optional(number, 4000)
check_interval = optional(string, "1s")
}
), {
limit_mib = 4000
check_interval = "1s"
}
)
resources = optional(object({
limit = object({
cpu = optional(string, "200m")
memory = optional(string, "200Mi")
})
requests = object({
cpu = optional(string, "200m")
memory = optional(string, "200Mi")
})
}), {
limit = {
cpu = "200m"
memory = "200Mi"
}
requests = {
cpu = "200m"
memory = "200Mi"
} })
})
|
{
"accept_namespace_regex": "(default|kube-system)",
"additional_metrics": [],
"helm_values": null,
"log_group_name": "adot",
"log_retention": 14,
"logging_enable": false,
"resources": {
"limit": {
"cpu": "200m",
"memory": "200Mi"
},
"requests": {
"cpu": "200m",
"memory": "200Mi"
}
}
}
| no | | [adot\_log\_group\_name](#input\_adot\_log\_group\_name) | ADOT log group name | `string` | `"adot_log_group_name"` | no | | [adot\_version](#input\_adot\_version) | The version of the AWS Distro for OpenTelemetry addon to use. | `string` | `"v0.78.0-eksbuild.1"` | no | | [cluster\_name](#input\_cluster\_name) | K8s cluster name. | `string` | n/a | yes | diff --git a/modules/adot/main.tf b/modules/adot/main.tf index 0c0a261..3f02e4c 100644 --- a/modules/adot/main.tf +++ b/modules/adot/main.tf @@ -42,6 +42,8 @@ resource "helm_release" "adot-collector" { resources_limit_memory = var.adot_config.resources.limit["memory"] resources_requests_cpu = var.adot_config.resources.requests["cpu"] resources_requests_memory = var.adot_config.resources.requests["memory"] + limit_mib = var.adot_config.memory_limiter.limit_mib + check_interval = var.adot_config.memory_limiter.check_interval }) ] diff --git a/modules/adot/variables.tf b/modules/adot/variables.tf index d33cb37..7579eda 100644 --- a/modules/adot/variables.tf +++ b/modules/adot/variables.tf @@ -46,6 +46,16 @@ variable "adot_config" { log_retention = optional(number, 14) helm_values = optional(any, null) logging_enable = optional(bool, false) + memory_limiter = optional(object( + { + limit_mib = optional(number, 4000) + check_interval = optional(string, "1s") + } + ), { + limit_mib = 4000 + check_interval = "1s" + } + ) resources = optional(object({ limit = object({ cpu = optional(string, "200m") From c4ab61f115b4b91ad1755999646cdc246e927c02 Mon Sep 17 00:00:00 2001 From: Aram Karapetyan Date: Fri, 26 Jan 2024 15:54:16 +0400 Subject: [PATCH 3/4] fix(DMVP-3391): Add memory limiter mib limit --- modules/adot/templates/adot-values.yaml.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/adot/templates/adot-values.yaml.tpl b/modules/adot/templates/adot-values.yaml.tpl index c9d7724..89b32d3 100644 --- a/modules/adot/templates/adot-values.yaml.tpl +++ b/modules/adot/templates/adot-values.yaml.tpl @@ -128,8 +128,8 @@ adotCollector: timeout: 30s send_batch_size: 8192 memory_limiter: - limit_mib: 4000 - check_interval: 1s + limit_mib: ${limit_mib} + check_interval: ${check_interval} exporters: awsemf/prometheus: dimension_rollup_option: NoDimensionRollup From 02b6415427874e4767cf23d475e8d1fe4dbf303c Mon Sep 17 00:00:00 2001 From: Aram Karapetyan Date: Fri, 26 Jan 2024 16:11:05 +0400 Subject: [PATCH 4/4] fix(DMVP-3391): Add memory limiter mib limit --- modules/adot/tests/basic/README.md | 2 +- modules/adot/variables.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/adot/tests/basic/README.md b/modules/adot/tests/basic/README.md index 97a80ae..d2cf26c 100644 --- a/modules/adot/tests/basic/README.md +++ b/modules/adot/tests/basic/README.md @@ -15,7 +15,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.41 | +| [aws](#provider\_aws) | 5.34.0 | ## Modules diff --git a/modules/adot/variables.tf b/modules/adot/variables.tf index 7579eda..d4d685a 100644 --- a/modules/adot/variables.tf +++ b/modules/adot/variables.tf @@ -48,11 +48,11 @@ variable "adot_config" { logging_enable = optional(bool, false) memory_limiter = optional(object( { - limit_mib = optional(number, 4000) + limit_mib = optional(number, 1000) check_interval = optional(string, "1s") } ), { - limit_mib = 4000 + limit_mib = 1000 check_interval = "1s" } )