From 130189669b73c6109d6e7e3a1ba73f91dd8e68e3 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:00:19 +0200 Subject: [PATCH] remove k8s metrics Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com> --- .../debugd/logcollector/logcollector.go | 3 +-- debugd/metricbeat/templates/metricbeat.yml | 23 ++++--------------- hack/logcollector/internal/metricbeat.go | 5 ++-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/debugd/internal/debugd/logcollector/logcollector.go b/debugd/internal/debugd/logcollector/logcollector.go index c2a6de5881..85bde6b2b8 100644 --- a/debugd/internal/debugd/logcollector/logcollector.go +++ b/debugd/internal/debugd/logcollector/logcollector.go @@ -283,8 +283,7 @@ type metricbeatConfInput struct { LogstashHost string CollectEtcdMetrics bool CollectSystemMetrics bool - CollectK8sMetrics bool - AddK8sMetadata bool + AddCloudMetadata bool } func writeTemplate(path string, templ *template.Template, in any) error { diff --git a/debugd/metricbeat/templates/metricbeat.yml b/debugd/metricbeat/templates/metricbeat.yml index 41ab90af82..2e6beb2a74 100644 --- a/debugd/metricbeat/templates/metricbeat.yml +++ b/debugd/metricbeat/templates/metricbeat.yml @@ -16,11 +16,6 @@ timestamp.precision: nanosecond # https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-path.html#_system_hostfs system.hostfs: "/hostfs" -{{ if .AddK8sMetadata }} -processors: - - add_kubernetes_metadata: ~ -{{ end }} - metricbeat.modules: {{ if .CollectSystemMetrics }} - module: system @@ -60,17 +55,9 @@ metricbeat.modules: key: "/etc/kubernetes/pki/etcd/peer.key" verification_mode: "full" {{ end }} - {{ if .CollectK8sMetrics }} - - module: kubernetes - metricsets: - - container - - node - - pod - - system - - volume - period: 10s - host: "${NODE_NAME}" - hosts: ["https://${NODE_NAME}:10250"] - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - ssl.verification_mode: "full" + + +processors: + {{ if .AddCloudMetadata }} + - add_cloud_metadata: ~ {{ end }} diff --git a/hack/logcollector/internal/metricbeat.go b/hack/logcollector/internal/metricbeat.go index 1295fee0bb..603f2dcd4f 100644 --- a/hack/logcollector/internal/metricbeat.go +++ b/hack/logcollector/internal/metricbeat.go @@ -45,7 +45,7 @@ func (p *MetricbeatPreparer) Prepare(dir string) error { LogstashHost: fmt.Sprintf("logstash-logstash:%d", p.port), Port: 5066, CollectSystemMetrics: true, - AddK8sMetadata: true, + AddCloudMetadata: true, }) if err != nil { return fmt.Errorf("template system metricbeat.yml: %w", err) @@ -54,7 +54,7 @@ func (p *MetricbeatPreparer) Prepare(dir string) error { LogstashHost: fmt.Sprintf("logstash-logstash:%d", p.port), Port: 5067, CollectEtcdMetrics: true, - AddK8sMetadata: true, + AddCloudMetadata: true, }) if err != nil { return fmt.Errorf("template k8s metricbeat.yml: %w", err) @@ -108,6 +108,7 @@ type MetricbeatTemplateData struct { CollectSystemMetrics bool CollectK8sMetrics bool AddK8sMetadata bool + AddCloudMetadata bool } // MetricbeatHelmValues repesents the Helm values.yml.