Skip to content

Commit

Permalink
remove k8s metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Sanft <[email protected]>
  • Loading branch information
msanft committed Sep 20, 2023
1 parent a880958 commit 1301896
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
3 changes: 1 addition & 2 deletions debugd/internal/debugd/logcollector/logcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 5 additions & 18 deletions debugd/metricbeat/templates/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
5 changes: 3 additions & 2 deletions hack/logcollector/internal/metricbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -108,6 +108,7 @@ type MetricbeatTemplateData struct {
CollectSystemMetrics bool
CollectK8sMetrics bool
AddK8sMetadata bool
AddCloudMetadata bool
}

// MetricbeatHelmValues repesents the Helm values.yml.
Expand Down

0 comments on commit 1301896

Please sign in to comment.