From b72586d1dd5fdda6694dd6517c33ef1cc0ca7e5a Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:16:18 +0100 Subject: [PATCH 01/11] chore: update tests --- .../helm/testdata/goldenfile/traces-sampler/simple.output.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml index ffca5a12c3..13985144ed 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml @@ -54,3 +54,6 @@ data: - batch receivers: - otlp + telemetry: + logs: + level: info From cf01974ea38b1d63074e1485464b47d6432af5bd Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:18:04 +0100 Subject: [PATCH 02/11] chore: move traces-sampler configuration from values.yaml --- .../instrumentation/traces.sampler.conf.yaml | 73 ++++++++++++++- .../traces-sampler/configmap.yaml | 12 ++- deploy/helm/sumologic/values.yaml | 89 ++++++------------- 3 files changed, 108 insertions(+), 66 deletions(-) diff --git a/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml b/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml index 5b3ce14e79..04255fb379 100644 --- a/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml +++ b/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml @@ -1 +1,72 @@ -{{- tpl (toYaml .Values.tracesSampler.config | replace ": '{{" ": {{" | replace "}}'" "}}") . | nindent 2 }} +{{ if .Values.sumologic.traces.enabled }} +exporters: +{{- if eq .Values.debug.instrumentation.tracesSampler.print true }} + debug: + verbosity: detailed +{{- end }} + ## Following generates verbose logs with span content, useful to verify what + ## metadata is being tagged. To enable, uncomment and add "logging" to exporters below. + ## There are two levels that could be used: `debug` and `info` with the former + ## being much more verbose and including (sampled) spans content + # logging: + # loglevel: debug + otlphttp: + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces + compression: gzip +receivers: + otlp: + protocols: + grpc: + endpoint: "0.0.0.0:4317" + http: + endpoint: "0.0.0.0:4318" +processors: + ## The memory_limiter processor is used to prevent out of memory situations on the collector. + memory_limiter: + ## check_interval is the time between measurements of memory usage for the + ## purposes of avoiding going over the limits. Defaults to zero, so no + ## checks will be performed. Values below 1 second are not recommended since + ## it can result in unnecessary CPU consumption. + check_interval: 5s + + ## Maximum amount of memory, in %, targeted to be allocated by the process heap. + ## Note that typically the total memory usage of process will be about 50MiB higher + ## than this value. + limit_percentage: 75 + + ## Maximum spike expected between the measurements of memory usage, in %. + spike_limit_percentage: 20 + + ## Smart cascading filtering rules with preset limits. + ## Please see https://github.com/SumoLogic/sumologic-otel-collector/tree/v0.92.0-sumo-0/pkg/processor/cascadingfilterprocessor + ## for details. + cascading_filter: + ## Max number of traces for which decisions are kept in memory + num_traces: 200000 + + ## The batch processor accepts spans and places them into batches grouped by node and resource + batch: + ## Number of spans after which a batch will be sent regardless of time + send_batch_size: 256 + ## Never more than this many spans are being sent in a batch + send_batch_max_size: 512 + ## Time duration after which a batch will be sent regardless of size + timeout: 5s + +extensions: + health_check: {} + memory_ballast: + ## Memory Ballast size should be max 1/3 to 1/2 of memory. + size_mib: 683 + pprof: {} +service: + extensions: [health_check, memory_ballast, pprof] + pipelines: + traces: + receivers: [otlp] + processors: [memory_limiter, cascading_filter, batch] + exporters: [otlphttp] + telemetry: + logs: + level: {{ .Values.tracesSampler.logLevel }} +{{- end }} diff --git a/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml b/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml index 0ab82f3bfa..dcb5c8208d 100644 --- a/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml +++ b/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml @@ -1,5 +1,14 @@ {{ $tracesEnabled := .Values.sumologic.traces.enabled }} {{- if $tracesEnabled }} +{{ $baseConfig := (tpl (.Files.Get "conf/instrumentation/traces.sampler.conf.yaml") .) | fromYaml }} +{{ $mergeConfig := .Values.tracesSampler.config.merge }} +{{ $overrideConfig := .Values.tracesSampler.config.override }} +{{ $finalConfig := "" }} +{{ if $overrideConfig }} +{{ $finalConfig = $overrideConfig }} +{{ else }} +{{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }} +{{ end }} apiVersion: v1 kind: ConfigMap metadata: @@ -9,5 +18,6 @@ metadata: app: {{ template "sumologic.labels.app.tracessampler.configmap" . }} {{- include "sumologic.labels.common" . | nindent 4 }} data: - {{- (tpl (.Files.Glob "conf/instrumentation/traces.sampler.conf.yaml").AsConfig .) | nindent 2 }} + traces.sampler.conf.yaml: | + {{- $finalConfig | toYaml | nindent 4 }} {{- end }} diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 58c5972749..10f4f4dccf 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -1586,71 +1586,28 @@ tracesSampler: ## To enable collecting all logs, set to false logLevelFilter: false - ## Collector configuration - config: - receivers: - otlp: - protocols: - grpc: - endpoint: "0.0.0.0:4317" - http: - endpoint: "0.0.0.0:4318" - processors: - ## The memory_limiter processor is used to prevent out of memory situations on the collector. - memory_limiter: - ## check_interval is the time between measurements of memory usage for the - ## purposes of avoiding going over the limits. Defaults to zero, so no - ## checks will be performed. Values below 1 second are not recommended since - ## it can result in unnecessary CPU consumption. - check_interval: 5s - - ## Maximum amount of memory, in %, targeted to be allocated by the process heap. - ## Note that typically the total memory usage of process will be about 50MiB higher - ## than this value. - limit_percentage: 75 - - ## Maximum spike expected between the measurements of memory usage, in %. - spike_limit_percentage: 20 - - ## Smart cascading filtering rules with preset limits. - ## Please see https://github.com/SumoLogic/sumologic-otel-collector/tree/v0.92.0-sumo-0/pkg/processor/cascadingfilterprocessor - ## for details. - cascading_filter: - ## Max number of traces for which decisions are kept in memory - num_traces: 200000 - - ## The batch processor accepts spans and places them into batches grouped by node and resource - batch: - ## Number of spans after which a batch will be sent regardless of time - send_batch_size: 256 - ## Never more than this many spans are being sent in a batch - send_batch_max_size: 512 - ## Time duration after which a batch will be sent regardless of size - timeout: 5s + ## Log Level + logLevel: info - extensions: - health_check: {} - memory_ballast: - ## Memory Ballast size should be max 1/3 to 1/2 of memory. - size_mib: 683 - pprof: {} - exporters: - ## Following generates verbose logs with span content, useful to verify what - ## metadata is being tagged. To enable, uncomment and add "logging" to exporters below. - ## There are two levels that could be used: `debug` and `info` with the former - ## being much more verbose and including (sampled) spans content - # logging: - # loglevel: debug - otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces - compression: gzip - service: - extensions: [health_check, memory_ballast, pprof] - pipelines: - traces: - receivers: [otlp] - processors: [memory_limiter, cascading_filter, batch] - exporters: [otlphttp] + ## Customize the Opentelemetry Collector configuration beyond the exposed options + config: + ## Directly alter the OT configuration. The value of this key should be a dictionary, that will + ## be directly merged with the generated configuration, overriding existing values. + ## For example: + # override: + # processors: + # batch: + # send_batch_size: 512 + ## will change the batch size of the pipeline. + ## + ## WARNING: This field is not subject to backwards-compatibility guarantees offered by the rest + ## of this chart. It involves implementation details that may change even in minor versions. + ## Use with caution, and consider opening an issue, so your customization can be added in a safer way. + merge: {} + ## Completely override existing config and replace it with the contents of this value. + ## The value of this key should be a dictionary, that will replace the normal configuration. + ## This is an advanced feature, use with caution, and review the generated configuration first. + override: {} metadata: ## Configure image for Opentelemetry Collector (for logs and metrics) @@ -2598,3 +2555,7 @@ debug: collector: print: false stopLogsIngestion: false + + instrumentation: + tracesSampler: + print: false From a8bca416b01a3f883ddff1e02436805f5cdfb1ce Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:20:32 +0100 Subject: [PATCH 03/11] docs: update parameters --- deploy/helm/sumologic/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 0ad8e08123..5692b93e00 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -363,11 +363,6 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `tracesSampler.deployment.nodeSelector` | Node selector for otelcol deployment. [See help.sumologic.com/docs/send-data/kubernetes/best-practices for more information.](https://help.sumologic.com/docs/send-data/kubernetes/best-practices/) | `{}` | | `tracesSampler.deployment.priorityClassName` | Priority class name for OpenTelemetry Collector log pods. | `Nil` | | `tracesSampler.logLevelFilter` | Do not send traces-sampler logs if `true`. | `false` | -| `tracesSampler.config.processors.batch.send_batch_size` | Sets the preferred size of batch. | `256` | -| `tracesSampler.config.processors.batch.send_batch_max_size` | Sets the maximum allowed size of a batch. Use with caution, setting too large value might cause 413 Payload Too Large errors. | `512` | -| `tracesSampler.config.processors.memory_limiter.limit_percentage` | Sets the maximum amount of memory, in %, targeted to be allocated by the process heap. | `75` | -| `tracesSampler.config.processors.memory_limiter.spike_limit_percentage` | Sets the maximum spike expected between the measurements of memory usage, in %. | `20` | -| `tracesSampler.config` | Configuration for traces-sampler. | See [values.yaml] | | `tracesSampler.deployment.extraEnvVars` | Additional environment variables for traces-sampler pods. | `{}` | | `tracesSampler.deployment.extraVolumeMounts` | Additional volume mounts for traces-sampler pods. | `{}` | | `tracesSampler.deployment.extraVolumes` | Additional volumes for traces-sampler pods. | `{}` | @@ -482,6 +477,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `pvcCleaner.job.podAnnotations` | Additional annotations for for the pvcCleaner container. | `{}` | | `pvcCleaner.job.schedule` | Schedule for cronJobs | `*/15 * * * *` | | `pvcCleaner.job.securityContext` | The securityContext configuration for the pvcCleaner. | `{"runAsUser": 1000}` | +| `debug.instrumentation.tracesSampler.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | | `debug.logs.collector.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | | `debug.logs.collector.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | | `debug.logs.metadata.forwardToSumologicMock` | Set to `true` to forward logs processed by metadata statefulset also to Sumo Logic Mock. | `false` | From dccf0e05e97614e143edceb919768f0e39ff4b10 Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:22:55 +0100 Subject: [PATCH 04/11] chore: add changelog --- .changelog/3526.changed.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/3526.changed.txt diff --git a/.changelog/3526.changed.txt b/.changelog/3526.changed.txt new file mode 100644 index 0000000000..38798befcd --- /dev/null +++ b/.changelog/3526.changed.txt @@ -0,0 +1 @@ +feat(tracessampler): move tracessampler config map from values.yaml \ No newline at end of file From 83a80c520b20f734bdf028b23532d1d5554dfa1c Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:29:09 +0100 Subject: [PATCH 05/11] chore: add missing parameters --- deploy/helm/sumologic/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 5692b93e00..0491ab1a06 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -359,6 +359,8 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `tracesGateway.deployment.resources` | Resources for traces-gateway statefulset. | `{"limits": {"memory": "2Gi", "cpu": "1000m"}, "requests": {"memory": "196Mi", "cpu": "50m"}}` | | `tracesGateway.deployment.startupProbe` | Startup probe configuration for the traces-gateway container. | `{"periodSeconds": 5, "timeoutSeconds": 3, "failureThreshold": 60}` | | `tracesGateway.deployment.tolerations` | Tolerations for traces-gateway statefulset. | `[]` | +| `tracesSampler.config.merge` | Configuration for traces-sampler collector, merged with defaults. | {} | +| `tracesSampler.config.override` | Configuration for log collector otelcol, replaces defaults. | {} | | `tracesSampler.deployment.replicas` | Set the number of OpenTelemetry Collector replicas. | `1` | | `tracesSampler.deployment.nodeSelector` | Node selector for otelcol deployment. [See help.sumologic.com/docs/send-data/kubernetes/best-practices for more information.](https://help.sumologic.com/docs/send-data/kubernetes/best-practices/) | `{}` | | `tracesSampler.deployment.priorityClassName` | Priority class name for OpenTelemetry Collector log pods. | `Nil` | From f4d11e097937d1a9afa3756c4f5bc56a6ea598b0 Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Mon, 5 Feb 2024 13:45:24 +0100 Subject: [PATCH 06/11] chore: add stoplogsingestion parameter for tracesampler --- deploy/helm/sumologic/README.md | 1 + deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml | 3 +++ deploy/helm/sumologic/templates/_helpers/_traces.tpl | 4 ++++ deploy/helm/sumologic/values.yaml | 1 + tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml | 3 +++ tests/helm/testdata/goldenfile/logs_otc/debug.output.yaml | 1 + 6 files changed, 13 insertions(+) diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 0491ab1a06..45e839642e 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -480,6 +480,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `pvcCleaner.job.schedule` | Schedule for cronJobs | `*/15 * * * *` | | `pvcCleaner.job.securityContext` | The securityContext configuration for the pvcCleaner. | `{"runAsUser": 1000}` | | `debug.instrumentation.tracesSampler.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | +| `debug.instrumentation.tracesSampler.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | | `debug.logs.collector.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | | `debug.logs.collector.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | | `debug.logs.metadata.forwardToSumologicMock` | Set to `true` to forward logs processed by metadata statefulset also to Sumo Logic Mock. | `false` | diff --git a/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml b/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml index 316cf4480e..6347f67c56 100644 --- a/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml +++ b/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml @@ -70,6 +70,9 @@ receivers: {{ if eq .Values.debug.metrics.collector.stopLogsIngestion true }} {{ include "metrics.collector.files.list" . }} {{ end }} + {{ if eq .Values.debug.instrumentation.tracesSampler.stopLogsIngestion true }} + {{ include "tracesSampler.collector.files.list" . }} + {{ end }} {{ if lt (int (include "kubernetes.minor" .)) 24 }} ## sets fingerprint_size to 17kb in order to match the longest possible docker line (which by default is 16kb) diff --git a/deploy/helm/sumologic/templates/_helpers/_traces.tpl b/deploy/helm/sumologic/templates/_helpers/_traces.tpl index d364c0b44d..7b6cae241b 100644 --- a/deploy/helm/sumologic/templates/_helpers/_traces.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_traces.tpl @@ -316,3 +316,7 @@ Example Usage: {{- template "kubernetes.defaultTolerations" . -}} {{- end -}} {{- end -}} + +{{- define "tracesSampler.collector.files.list" -}} +- /var/log/pods/{{ template "sumologic.namespace" . }}-{{ template "sumologic.metadata.name.tracessampler" . }}*/*/*.log +{{- end -}} diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 10f4f4dccf..e46d160a67 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -2559,3 +2559,4 @@ debug: instrumentation: tracesSampler: print: false + stopLogsIngestion: false diff --git a/tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml b/tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml index fcaadaf50c..14680fa2dc 100644 --- a/tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml @@ -15,3 +15,6 @@ debug: stopLogsIngestion: true metadata: stopLogsIngestion: true + instrumentation: + tracesSampler: + stopLogsIngestion: true diff --git a/tests/helm/testdata/goldenfile/logs_otc/debug.output.yaml b/tests/helm/testdata/goldenfile/logs_otc/debug.output.yaml index 94751cd628..98f2c14ce3 100644 --- a/tests/helm/testdata/goldenfile/logs_otc/debug.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc/debug.output.yaml @@ -63,6 +63,7 @@ data: - /var/log/pods/sumologic-RELEASE-NAME-sumologic-otelcol-logs-collector*/*/*.log - /var/log/pods/sumologic-RELEASE-NAME-sumologic-otelcol-metrics*/*/*.log - /var/log/pods/sumologic-RELEASE-NAME-sumologic-metrics*/*/*.log + - /var/log/pods/sumologic-RELEASE-NAME-sumologic-traces-sampler*/*/*.log include: - /var/log/pods/*/*/*.log include_file_name: false From 206b65cd356a70521fe32c49c473e6fafcdc05c7 Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Wed, 7 Feb 2024 16:31:07 +0100 Subject: [PATCH 07/11] chore: avoid breaking changes related to config --- .../sumologic/templates/_helpers/_common.tpl | 40 +++++++++++++++++++ .../traces-sampler/configmap.yaml | 9 +++++ 2 files changed, 49 insertions(+) diff --git a/deploy/helm/sumologic/templates/_helpers/_common.tpl b/deploy/helm/sumologic/templates/_helpers/_common.tpl index c83c374cf6..32fd6eaa58 100644 --- a/deploy/helm/sumologic/templates/_helpers/_common.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_common.tpl @@ -610,3 +610,43 @@ Example usage: {{- define "sumologic.sumologic-mock.name.roles.serviceaccount" -}} {{- template "sumologic.fullname" . }} {{- end -}} + +{{- define "useDefaultConfig" }} +{{/* +This function checks if any keys other than 'merge' and 'override' exist in a given map. +It takes a map as an argument and returns true if extra keys are found, else false. + +Example usage: +{{ $useValuesYamlConfig := include "useDefaultConfig" .Values.tracesSampler.config | trim }} +*/}} +{{- $map := . -}} +{{- $extraKeysExist := false -}} +{{- range $key, $_ := $map }} + {{- if and (ne $key "merge") (ne $key "override") }} + {{- $extraKeysExist = true -}} + {{- end }} +{{- end }} +{{- if $extraKeysExist }} +true +{{- else }} +false +{{- end }} +{{- end }} + +{{- define "removeMergeAndOverrideKeys" -}} +{{/* +This function removes keys 'merge' and 'override' in a given map. +It takes a map as an argument and returns new map without 'merge' and 'override' keys. + +Example usage: +{{ $finalConfig = include "removeMergeAndOverrideKeys" .Values.tracesSampler.config }} +*/}} +{{- $originalMap := . -}} +{{- $newMap := dict -}} +{{- range $key, $value := $originalMap -}} + {{- if and (ne $key "merge") (ne $key "override") -}} + {{- $_ := set $newMap $key $value -}} + {{- end -}} +{{- end -}} +{{ toYaml $newMap }} +{{- end -}} diff --git a/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml b/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml index dcb5c8208d..13fcc760b3 100644 --- a/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml +++ b/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml @@ -9,6 +9,11 @@ {{ else }} {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }} {{ end }} +{{ $valuesYamlConfig := .Values.tracesSampler.config }} +{{ $useValuesYamlConfig := include "useDefaultConfig" $valuesYamlConfig | trim }} +{{ if eq $useValuesYamlConfig "true" }} +{{ $finalConfig = include "removeMergeAndOverrideKeys" .Values.tracesSampler.config }} +{{ end }} apiVersion: v1 kind: ConfigMap metadata: @@ -19,5 +24,9 @@ metadata: {{- include "sumologic.labels.common" . | nindent 4 }} data: traces.sampler.conf.yaml: | + {{- if eq $useValuesYamlConfig "true" }} + {{- $finalConfig | nindent 4 }} + {{- else }} {{- $finalConfig | toYaml | nindent 4 }} + {{- end }} {{- end }} From a19e4e30ab6ab233dfe6ccb1d1e564de14656437 Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Wed, 7 Feb 2024 17:50:43 +0100 Subject: [PATCH 08/11] fix: set properly otlhttp endpoint --- .../conf/instrumentation/traces.sampler.conf.yaml | 6 +++++- .../goldenfile/traces-sampler/simple.output.yaml | 2 +- tests/integration/values/values_helm_http_source.yaml | 9 ++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml b/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml index 04255fb379..4e46a6da1f 100644 --- a/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml +++ b/deploy/helm/sumologic/conf/instrumentation/traces.sampler.conf.yaml @@ -11,7 +11,11 @@ exporters: # logging: # loglevel: debug otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces +{{- if eq .Values.sumologic.traces.sourceType "http" }} + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE} +{{- else }} + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE} +{{- end}} compression: gzip receivers: otlp: diff --git a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml index 13985144ed..8d56cb4b03 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml @@ -15,7 +15,7 @@ data: exporters: otlphttp: compression: gzip - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE} extensions: health_check: {} memory_ballast: diff --git a/tests/integration/values/values_helm_http_source.yaml b/tests/integration/values/values_helm_http_source.yaml index 030b28cd9b..18c7c260be 100644 --- a/tests/integration/values/values_helm_http_source.yaml +++ b/tests/integration/values/values_helm_http_source.yaml @@ -8,8 +8,11 @@ sumologic: traces: sourceType: http +## Adding /v1/traces just for testing purposes. +## Sumo HTTP Traces endpoint doesn't require "/v1/traces" path. tracesSampler: config: - exporters: - otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}/v1/traces + merge: + exporters: + otlphttp: + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}/v1/traces From 661aa82738994838b35ce0fc085122b709e8938d Mon Sep 17 00:00:00 2001 From: "Mateusz \"mat\" Rumian" <58699800+mat-rumian@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:50:48 +0100 Subject: [PATCH 09/11] Update deploy/helm/sumologic/README.md Co-authored-by: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> --- deploy/helm/sumologic/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 45e839642e..c496a4c552 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -480,7 +480,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `pvcCleaner.job.schedule` | Schedule for cronJobs | `*/15 * * * *` | | `pvcCleaner.job.securityContext` | The securityContext configuration for the pvcCleaner. | `{"runAsUser": 1000}` | | `debug.instrumentation.tracesSampler.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | -| `debug.instrumentation.tracesSampler.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | +| `debug.instrumentation.tracesSampler.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of traces-sampler logs. | `false` | | `debug.logs.collector.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | | `debug.logs.collector.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | | `debug.logs.metadata.forwardToSumologicMock` | Set to `true` to forward logs processed by metadata statefulset also to Sumo Logic Mock. | `false` | From 33f3480b47ecf3b49c3425ef5970ba5cd152a696 Mon Sep 17 00:00:00 2001 From: "Mateusz \"mat\" Rumian" <58699800+mat-rumian@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:51:04 +0100 Subject: [PATCH 10/11] Update deploy/helm/sumologic/templates/_helpers/_traces.tpl Co-authored-by: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> --- deploy/helm/sumologic/templates/_helpers/_traces.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/sumologic/templates/_helpers/_traces.tpl b/deploy/helm/sumologic/templates/_helpers/_traces.tpl index 7b6cae241b..af9b277fcb 100644 --- a/deploy/helm/sumologic/templates/_helpers/_traces.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_traces.tpl @@ -318,5 +318,5 @@ Example Usage: {{- end -}} {{- define "tracesSampler.collector.files.list" -}} -- /var/log/pods/{{ template "sumologic.namespace" . }}-{{ template "sumologic.metadata.name.tracessampler" . }}*/*/*.log +- /var/log/pods/{{ template "sumologic.namespace" . }}_{{ template "sumologic.metadata.name.tracessampler" . }}*/*/*.log {{- end -}} From 6d7809f5b0ef3fa146ca5cc8de44c2870d71ccb1 Mon Sep 17 00:00:00 2001 From: Mateusz Rumian Date: Thu, 8 Feb 2024 11:27:24 +0100 Subject: [PATCH 11/11] fix: readme formatting --- deploy/helm/sumologic/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 42d75bfdfc..1bc0318f7d 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -480,7 +480,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `pvcCleaner.job.schedule` | Schedule for cronJobs | `*/15 * * * *` | | `pvcCleaner.job.securityContext` | The securityContext configuration for the pvcCleaner. | `{"runAsUser": 1000}` | | `debug.instrumentation.tracesSampler.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | -| `debug.instrumentation.tracesSampler.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of traces-sampler logs. | `false` | +| `debug.instrumentation.tracesSampler.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of traces-sampler logs. | `false` | | `debug.logs.collector.print` | Set to `true` to print logs processed by log collector on standard output. | `false` | | `debug.logs.collector.stopLogsIngestion` | Set to `true` to prevent sending log collector logs to Sumo Logic. It prevents increasing ingestion and costs in case of huge amount of log collector logs. | `false` | | `debug.logs.metadata.forwardToSumologicMock` | Set to `true` to forward logs processed by metadata statefulset also to Sumo Logic Mock. | `false` |