From c23aef344db18454473b1aff668fadb530d4dc76 Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Fri, 5 Jan 2024 10:15:53 +0100 Subject: [PATCH] ci: don't export e2e metrics to OpenSearch (#2794) * ci: don't export e2e metrics to OpenSearch * debugd: don't export metrics --- .../actions/deploy_logcollection/action.yml | 14 ------ .../debugd/logcollector/logcollector.go | 47 ------------------- 2 files changed, 61 deletions(-) diff --git a/.github/actions/deploy_logcollection/action.yml b/.github/actions/deploy_logcollection/action.yml index 09b63886a..942ef56e4 100644 --- a/.github/actions/deploy_logcollection/action.yml +++ b/.github/actions/deploy_logcollection/action.yml @@ -90,17 +90,3 @@ runs: helm repo update helm install filebeat elastic/filebeat \ --wait --timeout=1200s --values values.yml - - - name: Deploy Metricbeat - id: deploy-metricbeat - shell: bash - working-directory: ./metricbeat - env: - KUBECONFIG: ${{ inputs.kubeconfig }} - run: | - helm repo add elastic https://helm.elastic.co - helm repo update - helm install metricbeat-k8s elastic/metricbeat \ - --wait --timeout=1200s --values values-control-plane.yml - helm install metricbeat-system elastic/metricbeat \ - --wait --timeout=1200s --values values-all-nodes.yml diff --git a/debugd/internal/debugd/logcollector/logcollector.go b/debugd/internal/debugd/logcollector/logcollector.go index 9e5c60165..c40859d0b 100644 --- a/debugd/internal/debugd/logcollector/logcollector.go +++ b/debugd/internal/debugd/logcollector/logcollector.go @@ -116,23 +116,6 @@ func NewStartTrigger(ctx context.Context, wg *sync.WaitGroup, provider cloudprov return } - logger.Infof("Getting metricbeat config template from image %s", versions.MetricbeatImage) - tmpl, err = getTemplate(ctx, logger, versions.MetricbeatImage, "/run/metricbeat/templates/metricbeat.yml", "/run/metricbeat") - if err != nil { - logger.Errorf("Getting metricbeat config template: %v", err) - return - } - metricbeatConf := metricbeatConfInput{ - LogstashHost: "localhost:5044", - Port: 5066, - CollectSystemMetrics: true, - AddCloudMetadata: true, - } - if err := writeTemplate("/run/metricbeat/metricbeat.yml", tmpl, metricbeatConf); err != nil { - logger.Errorf("Writing metricbeat pipeline: %v", err) - return - } - logger.Infof("Starting log collection pod") if err := startPod(ctx, logger); err != nil { logger.Errorf("Starting log collection: %v", err) @@ -243,28 +226,6 @@ func startPod(ctx context.Context, logger *logger.Logger) error { return fmt.Errorf("failed to run filebeat: %w", err) } - // start metricbeat container - metricbeatLog := newCmdLogger(logger.Named("metricbeat")) - runMetricbeatArgs := []string{ - "run", - "--rm", - "--name=metricbeat", - "--pod=logcollection", - "--privileged", - "--log-driver=none", - "--volume=/proc:/hostfs/proc:ro", - "--volume=/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro", - "--volume=/run/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro", - versions.MetricbeatImage, - } - runMetricbeatCmd := exec.CommandContext(ctx, "podman", runMetricbeatArgs...) - logger.Infof("Run metricbeat command: %v", runMetricbeatCmd.String()) - runMetricbeatCmd.Stdout = metricbeatLog - runMetricbeatCmd.Stderr = metricbeatLog - if err := runMetricbeatCmd.Start(); err != nil { - return fmt.Errorf("failed to run metricbeat: %w", err) - } - return nil } @@ -280,14 +241,6 @@ type filebeatConfInput struct { AddCloudMetadata bool } -type metricbeatConfInput struct { - Port int - LogstashHost string - CollectEtcdMetrics bool - CollectSystemMetrics bool - AddCloudMetadata bool -} - func writeTemplate(path string, templ *template.Template, in any) error { if err := os.MkdirAll(filepath.Dir(path), 0o777); err != nil { return fmt.Errorf("creating template dir: %w", err)