diff --git a/.changelog/3062.added.txt b/.changelog/3062.added.txt new file mode 100644 index 0000000000..66c10754f5 --- /dev/null +++ b/.changelog/3062.added.txt @@ -0,0 +1 @@ +feat(metric): allow disabling remote write proxy access logs \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 0a6b4aeebd..908eaf4d3b 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -95,6 +95,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.metrics.remoteWriteProxy.enabled` | Enable a load balancing proxy for Prometheus remote writes. [See docs/best-practices.md for more information.](/docs/best-practices.md) | `true` | | `sumologic.metrics.remoteWriteProxy.config.clientBodyBufferSize` | See the [nginx documentation](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size). Increase if you've also increased samples per send in Prometheus remote write. | `64k` | | `sumologic.metrics.remoteWriteProxy.config.workerCountAutotune` | This feature autodetects how much CPU is assigned to the nginx instance and setsthe right amount of workers based on that. Disable to use the default of 8 workers. | `true` | +| `sumologic.metrics.remoteWriteProxy.config.enableAccessLogs` | Enable nginx access logs. | `true` | | `sumologic.metrics.remoteWriteProxy.replicaCount` | Number of replicas in the remote write proxy deployment. | `3` | | `sumologic.metrics.remoteWriteProxy.image` | Nginx docker image for the remote write proxy. | `{"repository": "public.ecr.aws/sumologic/nginx-unprivileged", "tag": "1.23.3-alpine", "pullPolicy": "IfNotPresent"}` | | `sumologic.metrics.remoteWriteProxy.resources` | Resource requests and limits for the remote write proxy container. | `{"limits": {"cpu": "1000m", "memory": "256Mi"}, "requests": {"cpu": "100m", "memory": "128Mi"}}` | diff --git a/deploy/helm/sumologic/conf/metrics/remote-write-proxy/remote-write-proxy.conf b/deploy/helm/sumologic/conf/metrics/remote-write-proxy/remote-write-proxy.conf index 32ce362177..7101f01a27 100644 --- a/deploy/helm/sumologic/conf/metrics/remote-write-proxy/remote-write-proxy.conf +++ b/deploy/helm/sumologic/conf/metrics/remote-write-proxy/remote-write-proxy.conf @@ -4,7 +4,9 @@ upstream remote { server { listen {{ .Values.sumologic.metrics.remoteWriteProxy.config.port }} default_server; - +{{- if not .Values.sumologic.metrics.remoteWriteProxy.config.enableAccessLogs }} + access_log off; +{{- end }} location / { client_body_buffer_size {{ .Values.sumologic.metrics.remoteWriteProxy.config.clientBodyBufferSize }}; proxy_pass http://remote; diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index d98f444d8c..4fa81d8c98 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -467,6 +467,8 @@ sumologic: workerCountAutotune: true ## Nginx listen port port: 8080 + ## Nginx access logs + enableAccessLogs: true replicaCount: 3 image: repository: public.ecr.aws/sumologic/nginx-unprivileged diff --git a/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml b/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml index 3e84ecea77..e506002c41 100644 --- a/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml +++ b/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml @@ -15,6 +15,7 @@ sumologic: workerCountAutotune: false ## Nginx listen port port: 80 + enableAccessLogs: false replicaCount: 4 image: repository: public.ecr.aws/nginx/nginx-custom diff --git a/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.input.yaml b/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.input.yaml new file mode 100644 index 0000000000..f14a72dd8e --- /dev/null +++ b/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.input.yaml @@ -0,0 +1,8 @@ +sumologic: + metrics: + remoteWriteProxy: + enabled: true + config: + clientBodyBufferSize: "32k" + port: 80 + enableAccessLogs: false diff --git a/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.output.yaml b/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.output.yaml new file mode 100644 index 0000000000..4aa1154c01 --- /dev/null +++ b/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.output.yaml @@ -0,0 +1,25 @@ +--- +# Source: sumologic/templates/metrics/remote-write-proxy/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: RELEASE-NAME-sumologic-remote-write-proxy + labels: + app: RELEASE-NAME-sumologic-remote-write-proxy + chart: "sumologic-%CURRENT_CHART_VERSION%" + release: "RELEASE-NAME" + heritage: "Helm" +data: + remote-write-proxy.conf: | + upstream remote { + server RELEASE-NAME-sumologic-metadata-metrics:9888; + } + + server { + listen 80 default_server; + access_log off; + location / { + client_body_buffer_size 32k; + proxy_pass http://remote; + } + }