From 94d88804c6753e4add3d482077ae748c70dda1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Fri, 18 Aug 2023 12:17:12 +0200 Subject: [PATCH] feat(metrics/collector): adjust resources and autoscaling This is based on internal dogfooding. The collector is, in general, is heavily memory-bound, much like Prometheus. --- .changelog/3219.changed.txt | 1 + deploy/helm/sumologic/README.md | 6 +++--- deploy/helm/sumologic/values.yaml | 10 +++++----- .../goldenfile/metrics_collector_otc/basic.output.yaml | 6 +++--- .../metrics_collector_otc/custom.output.yaml | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 .changelog/3219.changed.txt diff --git a/.changelog/3219.changed.txt b/.changelog/3219.changed.txt new file mode 100644 index 0000000000..836ba24fba --- /dev/null +++ b/.changelog/3219.changed.txt @@ -0,0 +1 @@ +feat(metrics/collector): adjust resources and autoscaling \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index f94d3c13c9..72baf5d386 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -117,13 +117,13 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.metrics.serviceMonitors` | Configuration of Sumo Logic Kubernetes Collection components serviceMonitors | See [values.yaml] | | `sumologic.metrics.collector.otelcol.enabled` | Enable experimental otelcol metrics collector | See [values.yaml] | | `sumologic.metrics.collector.otelcol.scrapeInterval` | The default scrape interval for the collector. | `30s` | -| `sumologic.metrics.collector.otelcol.replicaCount` | Replica count for the experimental otelcol metrics collector | `3` | +| `sumologic.metrics.collector.otelcol.replicaCount` | Replica count for the experimental otelcol metrics collector | `1` | | `sumologic.metrics.collector.otelcol.resources` | Resource requests and limits for the experimental otelcol metrics collector | See [values.yaml] | | `sumologic.metrics.collector.otelcol.autoscaling.enabled` | Option to turn autoscaling on for the experimental otelcol metrics and specify params for HPA. Autoscaling needs metrics-server to access cpu metrics. collector | `false` | | `sumologic.metrics.collector.otelcol.autoscaling.maxReplicas` | Default max replicas for autoscaling. collector | `10` | | `sumologic.metrics.collector.otelcol.autoscaling.minReplicas` | Default min replicas for autoscaling. collector | `3` | -| `sumologic.metrics.collector.otelcol.autoscaling.targetCPUUtilizationPercentage` | The desired target CPU utilization for autoscaling. | `100` | -| `sumologic.metrics.collector.otelcol.autoscaling.targetMemoryUtilizationPercentage` | The desired target memory utilization for autoscaling. | `50` | +| `sumologic.metrics.collector.otelcol.autoscaling.targetCPUUtilizationPercentage` | The desired target CPU utilization for autoscaling. | `70` | +| `sumologic.metrics.collector.otelcol.autoscaling.targetMemoryUtilizationPercentage` | The desired target memory utilization for autoscaling. | `70` | | `sumologic.metrics.collector.otelcol.serviceMonitorSelector` | Selector for ServiceMonitors used for target discovery. By default, we select ServiceMonitors created by the Chart. See: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocatorprometheuscr | `Nil` | | `sumologic.metrics.collector.otelcol.podMonitorSelector` | Selector for PodMonitors used for target discovery. By default, we select PodMonitors created by the Chart. See: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocatorprometheuscr | `Nil` | | `sumologic.metrics.collector.otelcol.nodeSelector` | Node selector for the experimental otelcol metrics. [See docs/best-practices.md for more information.](/docs/best-practices.md). | `{}` | diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index ab4a6b8bb9..0c6b5f2654 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -474,8 +474,8 @@ sumologic: enabled: false minReplicas: 3 maxReplicas: 10 - targetCPUUtilizationPercentage: 100 - # targetMemoryUtilizationPercentage: 50 + targetCPUUtilizationPercentage: 70 + targetMemoryUtilizationPercentage: 70 nodeSelector: {} @@ -487,15 +487,15 @@ sumologic: ## Option to define priorityClassName to assign a priority class to pods. priorityClassName: - replicaCount: 3 + replicaCount: 1 resources: limits: - memory: 1Gi + memory: 2Gi cpu: 1000m requests: memory: 768Mi - cpu: 500m + cpu: 100m ## Selector for ServiceMonitors used for target discovery. By default, this selects resources created by this Chart. ## See https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocatorprometheuscr diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml index ca5b851cb6..007151eb7e 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.output.yaml @@ -14,7 +14,7 @@ metadata: sumologic.com/scrape: "true" spec: mode: statefulset - replicas: 3 + replicas: 1 serviceAccount: RELEASE-NAME-sumologic-metrics targetAllocator: serviceAccount: RELEASE-NAME-sumologic-metrics-targetallocator @@ -45,9 +45,9 @@ spec: resources: limits: cpu: 1000m - memory: 1Gi + memory: 2Gi requests: - cpu: 500m + cpu: 100m memory: 768Mi volumes: - name: tmp diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.output.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.output.yaml index c2f8223466..62b2b79ca5 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.output.yaml @@ -18,7 +18,7 @@ metadata: podKey: podValue spec: mode: statefulset - replicas: 3 + replicas: 1 serviceAccount: RELEASE-NAME-sumologic-metrics targetAllocator: serviceAccount: RELEASE-NAME-sumologic-metrics-targetallocator