diff --git a/charts/fluentd/Chart.yaml b/charts/fluentd/Chart.yaml index b70dac89..cdd2fa26 100644 --- a/charts/fluentd/Chart.yaml +++ b/charts/fluentd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: fluentd description: A Helm chart for Kubernetes # type: application -version: 0.2.3 +version: 0.2.4 appVersion: v1.12.0 icon: https://www.fluentd.org/assets/img/miscellany/fluentd-logo_2x.png home: https://www.fluentd.org/ diff --git a/charts/fluentd/templates/servicemonitor.yaml b/charts/fluentd/templates/servicemonitor.yaml index 4b542bdc..521b6c53 100644 --- a/charts/fluentd/templates/servicemonitor.yaml +++ b/charts/fluentd/templates/servicemonitor.yaml @@ -12,6 +12,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | default .Release.Name }} endpoints: - port: metrics path: /metrics @@ -21,6 +22,14 @@ spec: {{- with .Values.metrics.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} +{{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.metrics.serviceMonitor.metricRelabelings | indent 6) . }} +{{- end }} +{{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: +{{ toYaml .Values.metrics.serviceMonitor.relabelings | indent 6 }} +{{- end }} {{- if .Values.metrics.serviceMonitor.namespaceSelector }} namespaceSelector: {{ toYaml .Values.metrics.serviceMonitor.namespaceSelector | indent 4 -}} diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index 3ee6b988..ef5ddfd0 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -135,6 +135,26 @@ metrics: release: prometheus-operator namespace: "" namespaceSelector: {} + ## metric relabel configs to apply to samples before ingestion. + ## + metricRelabelings: [] + # - sourceLabels: [__name__] + # separator: ; + # regex: ^fluentd_output_status_buffer_(oldest|newest)_.+ + # replacement: $1 + # action: drop + ## relabel configs to apply to samples after ingestion. + ## + relabelings: [] + # - sourceLabels: [__meta_kubernetes_pod_node_name] + # separator: ; + # regex: ^(.*)$ + # targetLabel: nodename + # replacement: $1 + # action: replace + ## Additional serviceMonitor config + ## + # jobLabel: fluentd # scrapeInterval: 30s # scrapeTimeout: 5s # honorLabels: true