Skip to content

Commit

Permalink
ci: don't export e2e metrics to OpenSearch (#2794)
Browse files Browse the repository at this point in the history
* ci: don't export e2e metrics to OpenSearch
* debugd: don't export metrics
  • Loading branch information
burgerdev authored Jan 5, 2024
1 parent 136a69e commit c23aef3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
14 changes: 0 additions & 14 deletions .github/actions/deploy_logcollection/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
47 changes: 0 additions & 47 deletions debugd/internal/debugd/logcollector/logcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand All @@ -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)
Expand Down

0 comments on commit c23aef3

Please sign in to comment.