Skip to content

Commit

Permalink
fix: use fluentd.excludeNamespaces helm template, also for tracing co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
pmalek committed Oct 26, 2021
1 parent cde4e6c commit 863def2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,7 @@
<filter containers.**>
@type kubernetes_sumologic
@include logs.kubernetes.sumologic.filter.conf
{{- if eq .Values.sumologic.collectionMonitoring false }}
{{- if .Values.fluentd.logs.containers.excludeNamespaceRegex }}
exclude_namespace_regex {{ printf "%s|%s" .Release.Namespace .Values.fluentd.logs.containers.excludeNamespaceRegex | quote }}
{{- else }}
exclude_namespace_regex {{ printf "%s" .Release.Namespace | quote }}
{{- end }}
{{- else }}
exclude_namespace_regex {{ .Values.fluentd.logs.containers.excludeNamespaceRegex | quote }}
{{- end }}
exclude_namespace_regex {{ include "fluentd.excludeNamespaces" . }}
</filter>
{{- .Values.fluentd.logs.containers.extraOutputPluginConf | nindent 4 }}
{{ if .Values.fluentd.logs.containers.overrideOutputConf }}
Expand Down
5 changes: 1 addition & 4 deletions deploy/helm/sumologic/conf/traces/traces.otelcol.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
{{- $sourceCategory := .Values.fluentd.logs.containers.sourceCategory | quote }}
{{- $sourceCategoryPrefix := .Values.fluentd.logs.containers.sourceCategoryPrefix | quote }}
{{- $sourceCategoryReplaceDash := .Values.fluentd.logs.containers.sourceCategoryReplaceDash | quote }}
{{- $excludeNamespaceRegex := .Values.fluentd.logs.containers.excludeNamespaceRegex | quote }}
{{ if eq .Values.sumologic.collectionMonitoring false }}
{{- $excludeNamespaceRegex = printf "%s|%s" .Release.Namespace .Values.fluentd.logs.containers.excludeNamespaceRegex | quote }}
{{- end }}
{{- $excludeNamespaceRegex := include "fluentd.excludeNamespaces" . }}
{{- $excludePodRegex := .Values.fluentd.logs.containers.excludePodRegex | quote }}
{{- $excludeContainerRegex := .Values.fluentd.logs.containers.excludeContainerRegex | quote }}
{{- $excludeHostRegex := .Values.fluentd.logs.containers.excludeHostRegex | quote }}
Expand Down
6 changes: 5 additions & 1 deletion deploy/helm/sumologic/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,11 @@ Example:
{{- define "fluentd.excludeNamespaces" -}}
{{- $excludeNamespaceRegex := .Values.fluentd.logs.containers.excludeNamespaceRegex | quote -}}
{{- if eq .Values.sumologic.collectionMonitoring false -}}
{{- $excludeNamespaceRegex = printf "%s|%s" .Release.Namespace .Values.fluentd.logs.containers.excludeNamespaceRegex | quote }}
{{- if .Values.fluentd.logs.containers.excludeNamespaceRegex -}}
{{- $excludeNamespaceRegex = printf "%s|%s" .Release.Namespace .Values.fluentd.logs.containers.excludeNamespaceRegex | quote -}}
{{- else -}}
{{- $excludeNamespaceRegex = printf "%s" .Release.Namespace | quote -}}
{{- end -}}
{{- end -}}
{{ print $excludeNamespaceRegex }}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ metadata:
heritage: "Helm"
data:
traces.otelcol.conf.yaml: |
exporters:
otlphttp:
compression: gzip
Expand Down
1 change: 0 additions & 1 deletion tests/tracing/static/simple.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ metadata:
heritage: "Helm"
data:
traces.otelcol.conf.yaml: |
exporters:
otlphttp:
compression: gzip
Expand Down

0 comments on commit 863def2

Please sign in to comment.