From 0a6ceb36510f3f0145999f81514a88730d80b723 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek Date: Tue, 26 May 2020 18:47:10 +0200 Subject: [PATCH] Use more obvious configuration relation --- .../helm/sumologic/conf/metrics/metrics.conf | 6 +++++- deploy/helm/sumologic/templates/_helpers.tpl | 2 +- deploy/helm/sumologic/values.yaml | 18 +----------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/deploy/helm/sumologic/conf/metrics/metrics.conf b/deploy/helm/sumologic/conf/metrics/metrics.conf index 0c23744cca..218db6b57f 100644 --- a/deploy/helm/sumologic/conf/metrics/metrics.conf +++ b/deploy/helm/sumologic/conf/metrics/metrics.conf @@ -47,6 +47,10 @@ {{- range $_, $key := $out_keys | sortAlpha }} {{- $name := join "_" (slice (splitList "_" $key) 2) }} {{- $source := index $ctx.Values.fluentd.metrics.output $name }} -{{ include "utils.metrics.match" (dict "Context" $ctx "Match" $source.match "Id" $source.id "Endpoint" $source.endpoint "Storage" (index $ctx.Values.fluentd.buffer.filePaths.metrics $name) ) | nindent 4 }} +{{- $endpoint := $name }} +{{- if $source.source -}} +{{- $endpoint = $source.source -}} +{{- end -}} +{{ include "utils.metrics.match" (dict "Context" $ctx "Match" $source.match "Id" $source.id "Endpoint" $endpoint "Storage" (index $ctx.Values.fluentd.buffer.filePaths.metrics $name) ) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/deploy/helm/sumologic/templates/_helpers.tpl b/deploy/helm/sumologic/templates/_helpers.tpl index 8f72382366..89fa78198e 100644 --- a/deploy/helm/sumologic/templates/_helpers.tpl +++ b/deploy/helm/sumologic/templates/_helpers.tpl @@ -153,7 +153,7 @@ Example usage: */}} {{- define "terraform.sources.data" -}} -{{ printf "endpoint-%-32s = \"${sumologic_http_source.%s.url}\"" .endpoint (include "terraform.sources.name" .) }} +{{ printf "endpoint-%-32s = \"${sumologic_http_source.%s.url}\"" .name (include "terraform.sources.name" .) }} {{- end -}} diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 4d44902f4f..f8568c7778 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -90,35 +90,27 @@ sumologic: default: name: default-metrics value: (default-metrics) - endpoint: metrics apiserver: name: apiserver-metrics value: apiserver-metrics - endpoint: metrics-apiserver controller: name: kube-controller-manager-metrics value: kube-controller-manager-metrics - endpoint: metrics-kube-controller-manager scheduler: name: kube-scheduler-metrics value: kube-scheduler-metrics - endpoint: metrics-kube-scheduler state: name: kube-state-metrics value: kube-state-metrics - endpoint: metrics-kube-state kubelet: name: kubelet-metrics value: kubelet-metrics - endpoint: metrics-kubelet node: name: node-exporter-metrics value: node-exporter-metrics - endpoint: metrics-node-exporter control-plane: name: control-plane-metrics value: control-plane-metrics - endpoint: control-plane # Traces configuration # This is experimental feature and may be unavailable for your account @@ -437,47 +429,39 @@ fluentd: apiserver: match: prometheus.metrics.apiserver** id: sumologic.endpoint.metrics.apiserver - endpoint: metrics-apiserver weight: 90 kubelet: match: prometheus.metrics.kubelet** id: sumologic.endpoint.metrics.kubelet - endpoint: metrics-kubelet weight: 90 container: match: prometheus.metrics.container** id: sumologic.endpoint.metrics.container - endpoint: metrics-kubelet + source: kubelet weight: 90 controller: match: prometheus.metrics.controller-manager** id: sumologic.endpoint.metrics.kube.controller.manager - endpoint: metrics-kube-controller-manager weight: 90 scheduler: match: prometheus.metrics.scheduler** id: sumologic.endpoint.metrics.kube.scheduler - endpoint: metrics-kube-scheduler weight: 90 state: match: prometheus.metrics.state** id: sumologic.endpoint.metrics.kube.state - endpoint: metrics-kube-state weight: 90 node: match: prometheus.metrics.node** id: sumologic.endpoint.metrics.node.exporter - endpoint: metrics-node-exporter weight: 90 control-plane: match: prometheus.metrics.control-plane** id: sumologic.endpoint.metrics.control.plane - endpoint: metrics-control-plane weight: 90 default: match: prometheus.metrics** id: sumologic.endpoint.metrics - endpoint: metrics weight: 100 events: