Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add options to control to otel resources #5

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cluster/collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ processors:
timeout: 30s
send_batch_size: 800
memory_limiter:
check_interval: 1s
limit_percentage: 70
spike_limit_percentage: 30
check_interval: ${check_interval}
limit_percentage: ${limit_percentage}
spike_limit_percentage: ${spike_limit_percentage}
resource/1:
attributes:
- key: service.name
Expand Down
8 changes: 8 additions & 0 deletions cluster/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ resource "kubernetes_config_map" "doit_collector_config" {
collector_bucket_name = local.s3_bucket
collector_bucket_prefix = "eks-metrics/${local.account_id}/${local.region}/${var.cluster.name}"
region = local.region
check_interval = var.otel_memory_limiter.check_interval
limit_percentage = var.otel_memory_limiter.limit_percentage
spike_limit_percentage = var.otel_memory_limiter.spike_limit_percentage
}
)}"
}
Expand Down Expand Up @@ -489,6 +492,11 @@ resource "kubernetes_deployment" "collector" {
}
}

resources {
requests = var.otel_resources.requests
limits = var.otel_resources.limits
}

volume_mount {
mount_path = "/conf"
name = "doit-collector-config"
Expand Down
29 changes: 29 additions & 0 deletions cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,32 @@ variable "permissions_boundary" {
description = "If provided, all IAM roles will be created with this permissions boundary attached."
default = ""
}

variable "otel_memory_limiter" {
type = object({
check_interval = string
limit_percentage: number
spike_limit_percentage: number

})
default = {
check_interval: "1s"
limit_percentage: 70
spike_limit_percentage: 30
}
hobord marked this conversation as resolved.
Show resolved Hide resolved
}

variable "otel_resources" {
type = object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
})
)})

default = {}
}