Skip to content

Commit fa67f7b

Browse files
collector: add collector section
1 parent e9d8f8f commit fa67f7b

File tree

4 files changed

+62
-47
lines changed

4 files changed

+62
-47
lines changed

charts/victoria-logs-collector/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Next release
22

3-
- TODO
3+
- moved all collector-specific properties to `collector` section. List of moved properties: `msgField`, `timeField`, `includeNodeAnnotations`, `includePodAnnotations`, `includePodLabels`, `includeNodeAnnotations` and `excludeFilter`. Old properties are supported as well.
44

55
## 0.2.0
66

charts/victoria-logs-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
type: application
33
name: victoria-logs-collector
44
description: VictoriaLogs Collector - collects logs from Kubernetes containers and stores them to VictoriaLogs
5-
version: 0.2.0
5+
version: 0.2.1
66
appVersion: v1.43.0
77
sources:
88
- https://github.com/VictoriaMetrics/helm-charts

charts/victoria-logs-collector/templates/_helpers.tpl

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,34 @@
6060
{{- fail "at least one remoteWrite configuration must be provided" }}
6161
{{- end }}
6262

63-
{{- $args := dict "kubernetesCollector" true }}
64-
{{- $_ := set $args "kubernetesCollector.msgField" (join "," ($Values.msgField | default (list "message"))) }}
65-
{{- $_ := set $args "kubernetesCollector.timeField" (join "," ($Values.timeField | default (list "timestamp"))) }}
66-
{{- with $Values.excludeFilter }}
67-
{{- $_ := set $args "kubernetesCollector.excludeFilter" . }}
68-
{{- end }}
69-
{{- $_ := set $args "kubernetesCollector.includePodLabels" $Values.includePodLabels }}
70-
{{- $_ := set $args "kubernetesCollector.includePodAnnotations" $Values.includePodAnnotations }}
71-
{{- $_ := set $args "kubernetesCollector.includeNodeLabels" $Values.includeNodeLabels }}
72-
{{- $_ := set $args "kubernetesCollector.includeNodeAnnotations" $Values.includeNodeAnnotations }}
73-
{{- $_ := set $args "envflag.enable" true }}
63+
{{- $args := dict "envflag.enable" true }}
7464
{{- $_ := set $args "envflag.prefix" "VL_" }}
7565
{{- $_ := set $args "tmpDataPath" "/vl-collector" }}
7666
{{- $_ := set $args "remoteWrite.tmpDataPath" "/vl-collector/remotewrite-data" }}
7767
{{- $args = mergeOverwrite $args (fromYaml (include "vm.license.flag" .)) }}
7868

69+
{{- $collector := $Values.collector | default dict }}
70+
{{- with $collector }}
71+
{{- $_ := set $args "kubernetesCollector" true }}
72+
73+
{{- $collectorProps := list "msgField" "timeField" "excludeFilter" "includePodLabels" "includePodAnnotations" "includeNodeLabels" "includeNodeAnnotations" }}
74+
{{- range $prop := $collectorProps }}
75+
{{- $value := index $collector $prop }}
76+
{{- if hasKey $Values $prop }}
77+
{{- $value = index $Values $prop }}
78+
{{- end }}
79+
{{- if or (kindIs "bool" $value) $value }}
80+
{{- $vs := "" }}
81+
{{- if kindIs "slice" $value }}
82+
{{- $vs = join "," $value }}
83+
{{- else }}
84+
{{- $vs = toString $value }}
85+
{{- end }}
86+
{{- $_ := set $args (printf "kubernetesCollector.%s" $prop) $vs }}
87+
{{- end }}
88+
{{- end }}
89+
{{- end }}
90+
7991
{{- $requiredParams := list "url" }}
8092

8193
{{- range $i, $oldRw := $Values.remoteWrite }}

charts/victoria-logs-collector/values.yaml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,43 @@ remoteWrite: []
3838
# - url: https://victoria-logs:9428
3939
# tlsInsecureSkipVerify: true
4040

41-
# -- List of fields to be used as `_time` field. The first found field will be used.
42-
# See https://docs.victoriametrics.com/victorialogs/keyconcepts/#time-field for more details.
43-
timeField:
44-
- time
45-
- ts
46-
- timestamp
47-
48-
# -- List of fields to be used as `_msg` field. The first found field will be used.
49-
# See https://docs.victoriametrics.com/victorialogs/keyconcepts/#message-field for more details.
50-
msgField:
51-
- message
52-
- msg
53-
54-
# -- LogsQL filter for excluding container logs.
55-
# The filter is applied to container metadata fields (e.g., kubernetes.namespace_name, kubernetes.container_name) before reading the log files.
56-
# This significantly reduces CPU and I/O usage by skipping logs from unwanted containers.
57-
# See https://docs.victoriametrics.com/victorialogs/vlagent/#filtering-kubernetes-logs
58-
excludeFilter: ""
59-
60-
# -- Include Pod labels as additional fields in the log entries.
61-
# Even this setting is disabled, Pod labels are available for filtering via .Values.excludeFilter parameter
62-
includePodLabels: true
63-
64-
# -- Include Pod annotations as additional fields in the log entries.
65-
# Even this setting is disabled, Pod annotations are available for filtering via .Values.excludeFilter parameter
66-
includePodAnnotations: false
67-
68-
# -- Include Node labels as additional fields in the log entries.
69-
# Even this setting is disabled, Node labels are available for filtering via .Values.excludeFilter parameter
70-
includeNodeLabels: false
71-
72-
# -- Include Node annotations as additional fields in the log entries.
73-
# Even this setting is disabled, Node annotations are available for filtering via .Values.excludeFilter parameter
74-
includeNodeAnnotations: false
41+
# -- List of collector specific properties
42+
collector:
43+
44+
# -- List of fields to be used as `_time` field. The first found field will be used.
45+
# See https://docs.victoriametrics.com/victorialogs/keyconcepts/#time-field for more details.
46+
timeField:
47+
- time
48+
- ts
49+
- timestamp
50+
51+
# -- List of fields to be used as `_msg` field. The first found field will be used.
52+
# See https://docs.victoriametrics.com/victorialogs/keyconcepts/#message-field for more details.
53+
msgField:
54+
- message
55+
- msg
56+
57+
# -- LogsQL filter for excluding container logs.
58+
# The filter is applied to container metadata fields (e.g., kubernetes.namespace_name, kubernetes.container_name) before reading the log files.
59+
# This significantly reduces CPU and I/O usage by skipping logs from unwanted containers.
60+
# See https://docs.victoriametrics.com/victorialogs/vlagent/#filtering-kubernetes-logs
61+
excludeFilter: ""
62+
63+
# -- Include Pod labels as additional fields in the log entries.
64+
# Even this setting is disabled, Pod labels are available for filtering via .Values.excludeFilter parameter
65+
includePodLabels: true
66+
67+
# -- Include Pod annotations as additional fields in the log entries.
68+
# Even this setting is disabled, Pod annotations are available for filtering via .Values.excludeFilter parameter
69+
includePodAnnotations: false
70+
71+
# -- Include Node labels as additional fields in the log entries.
72+
# Even this setting is disabled, Node labels are available for filtering via .Values.excludeFilter parameter
73+
includeNodeLabels: false
74+
75+
# -- Include Node annotations as additional fields in the log entries.
76+
# Even this setting is disabled, Node annotations are available for filtering via .Values.excludeFilter parameter
77+
includeNodeAnnotations: false
7578

7679
# -- Environment variables (ex.: secret tokens).
7780
env: []

0 commit comments

Comments
 (0)