Skip to content

Commit

Permalink
Merge pull request #95 from dasmeta/DMVP-3391
Browse files Browse the repository at this point in the history
fix(DMVP-3391): Add memory limiter mib limit
  • Loading branch information
viktoryathegreat authored Jan 31, 2024
2 parents 3acdc34 + 02b6415 commit dcd85ab
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/spot-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.41 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/adot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adot_collector_policy_arns"></a> [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 |
| <a name="input_adot_config"></a> [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. | <pre>object({<br> accept_namespace_regex = optional(string, "(default|kube-system)")<br> additional_metrics = optional(list(string), [])<br> log_group_name = optional(string, "adot")<br> log_retention = optional(number, 14)<br> helm_values = optional(any, null)<br> logging_enable = optional(bool, false)<br> resources = optional(object({<br> limit = object({<br> cpu = optional(string, "200m")<br> memory = optional(string, "200Mi")<br> })<br> requests = object({<br> cpu = optional(string, "200m")<br> memory = optional(string, "200Mi")<br> })<br> }), {<br> limit = {<br> cpu = "200m"<br> memory = "200Mi"<br> }<br> requests = {<br> cpu = "200m"<br> memory = "200Mi"<br> } })<br> })</pre> | <pre>{<br> "accept_namespace_regex": "(default|kube-system)",<br> "additional_metrics": [],<br> "helm_values": null,<br> "log_group_name": "adot",<br> "log_retention": 14,<br> "logging_enable": false,<br> "resources": {<br> "limit": {<br> "cpu": "200m",<br> "memory": "200Mi"<br> },<br> "requests": {<br> "cpu": "200m",<br> "memory": "200Mi"<br> }<br> }<br>}</pre> | no |
| <a name="input_adot_config"></a> [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. | <pre>object({<br> accept_namespace_regex = optional(string, "(default|kube-system)")<br> additional_metrics = optional(list(string), [])<br> log_group_name = optional(string, "adot")<br> log_retention = optional(number, 14)<br> helm_values = optional(any, null)<br> logging_enable = optional(bool, false)<br> memory_limiter = optional(object(<br> {<br> limit_mib = optional(number, 4000)<br> check_interval = optional(string, "1s")<br> }<br> ), {<br> limit_mib = 4000<br> check_interval = "1s"<br> }<br> )<br> resources = optional(object({<br> limit = object({<br> cpu = optional(string, "200m")<br> memory = optional(string, "200Mi")<br> })<br> requests = object({<br> cpu = optional(string, "200m")<br> memory = optional(string, "200Mi")<br> })<br> }), {<br> limit = {<br> cpu = "200m"<br> memory = "200Mi"<br> }<br> requests = {<br> cpu = "200m"<br> memory = "200Mi"<br> } })<br> })</pre> | <pre>{<br> "accept_namespace_regex": "(default|kube-system)",<br> "additional_metrics": [],<br> "helm_values": null,<br> "log_group_name": "adot",<br> "log_retention": 14,<br> "logging_enable": false,<br> "resources": {<br> "limit": {<br> "cpu": "200m",<br> "memory": "200Mi"<br> },<br> "requests": {<br> "cpu": "200m",<br> "memory": "200Mi"<br> }<br> }<br>}</pre> | no |
| <a name="input_adot_log_group_name"></a> [adot\_log\_group\_name](#input\_adot\_log\_group\_name) | ADOT log group name | `string` | `"adot_log_group_name"` | no |
| <a name="input_adot_version"></a> [adot\_version](#input\_adot\_version) | The version of the AWS Distro for OpenTelemetry addon to use. | `string` | `"v0.78.0-eksbuild.1"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | K8s cluster name. | `string` | n/a | yes |
Expand Down
2 changes: 2 additions & 0 deletions modules/adot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
]

Expand Down
4 changes: 2 additions & 2 deletions modules/adot/templates/adot-values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ adotCollector:
timeout: 30s
send_batch_size: 8192
memory_limiter:
limit_mib: 100
check_interval: 5s
limit_mib: ${limit_mib}
check_interval: ${check_interval}
exporters:
awsemf/prometheus:
dimension_rollup_option: NoDimensionRollup
Expand Down
2 changes: 1 addition & 1 deletion modules/adot/tests/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.41 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.34.0 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions modules/adot/tests/template_file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.41 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.63.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | 2.9.0 |
| <a name="provider_test"></a> [test](#provider\_test) | n/a |

## Modules
Expand Down
10 changes: 10 additions & 0 deletions modules/adot/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, 1000)
check_interval = optional(string, "1s")
}
), {
limit_mib = 1000
check_interval = "1s"
}
)
resources = optional(object({
limit = object({
cpu = optional(string, "200m")
Expand Down

0 comments on commit dcd85ab

Please sign in to comment.