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(metrics): allow overriding metrics collector configuration #3314

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .changelog/3314.added.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat(metrics): allow overriding metrics collector configuration
2 changes: 2 additions & 0 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ The following table lists the configurable parameters of the Sumo Logic chart an
| `sumologic.metrics.collector.otelcol.cAdvisor.enabled` | Enable collection of cAdvisor metrics. | `true` |
| `sumologic.metrics.collector.otelcol.annotatedPods.enabled` | Enable collection of metrics from Pods annotated with prometheus.io/\* keys. See [docs/collecting-application-metrics.md](/docs/collecting-application-metrics.md#application-metrics-are-exposed-one-endpoint-scenario) for more information. | `true` |
| `sumologic.metrics.collector.otelcol.allocationStrategy` | Allocation strategy for the scrape target allocator. Valid values are: least-weighted and consistent-hashing. See: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocator | `least-weighted` |
| `sumologic.metrics.collector.otelcol.config.merge` | Configuration for otelcol metrics collector, merged with defaults. See also https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/configuration.md. | {} |
| `sumologic.metrics.collector.otelcol.config.override` | Configuration for otelcol metrics collector, replaces defaults. See also https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/configuration.md. | {} |
| `sumologic.metrics.dropHistogramBuckets` | Drop buckets from select high-cardinality histogram metrics, leaving only the sum and count components. | `true` |
| `sumologic.metrics.sourceType` | The type of the Sumo Logic source being used for metrics ingestion. Can be `http` or `otlp`. | `otlp` |
| `sumologic.traces.enabled` | Set the enabled flag to true to enable tracing ingestion. _Tracing must be enabled for the account first. Please contact your Sumo representative for activation details_ | `true` |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{{- if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
{{ $baseConfig := (tpl (.Files.Get "conf/metrics/collector/otelcol/config.yaml") .) | fromYaml }}
{{ $mergeConfig := .Values.sumologic.metrics.collector.otelcol.config.merge }}
{{ $overrideConfig := .Values.sumologic.metrics.collector.otelcol.config.override }}
{{ $finalConfig := "" }}
{{ if $overrideConfig }}
{{ $finalConfig = $overrideConfig }}
{{ else }}
{{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
{{ end }}
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
Expand Down Expand Up @@ -98,5 +107,5 @@ spec:
- name: file-storage
mountPath: /var/lib/storage/otc
config: |
{{- (tpl (.Files.Get "conf/metrics/collector/otelcol/config.yaml") .) | nindent 4 }}
{{- $finalConfig | toYaml | nindent 4 }}
{{- end }}
19 changes: 19 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,25 @@ sumologic:
## See: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocator
# allocationStrategy: least-weighted

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: {}

## Default metric filters for Sumo Apps
enableDefaultFilters: false

Expand Down
Loading
Loading