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

feat(tracessampler): move tracessampler config map from values.yaml #3526

Merged
merged 12 commits into from
Feb 8, 2024
1 change: 1 addition & 0 deletions .changelog/3526.changed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat(tracessampler): move tracessampler config map from values.yaml
8 changes: 3 additions & 5 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,12 @@ 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` |
| `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. | `{}` |
Expand Down Expand Up @@ -482,6 +479,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` |
mat-rumian marked this conversation as resolved.
Show resolved Hide resolved
| `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` |
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}