lapsus
lapsus

Reputation: 3035

kubernetes filebeat disable metrics monitoring

I do not want filebeat to report any metrics to elasticsearch.

Once I start the deamon set I can see the following message:

2020-03-17T09:14:59.524Z        INFO    [monitoring]    log/log.go:118  Starting metrics logging every 30s

How can you disable that?
Basically what I think I need is logging.metrics.enabled: false or is it monitoring.enabled: false ? I just cannot make it work. I'm not sure where to put it. The documentation just says to put it into the logging section of my filebeat.yaml. So I added it on the same intendation level as "filebeat.inputs". To no success... - where do I need to put it? Or is it the completely wrong configuration setting I am looking at?

https://raw.githubusercontent.com/elastic/beats/master/deploy/kubernetes/filebeat-kubernetes.yaml

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: kube-system
  labels:
    k8s-app: filebeat
data:
  filebeat.yml: |-
    filebeat.inputs:
    - type: container
      paths:
        - /var/log/containers/*.log
      processors:
        - add_kubernetes_metadata:
            host: ${NODE_NAME}
            matchers:
            - logs_path:
                logs_path: "/var/log/containers/"

    # To enable hints based autodiscover, remove `filebeat.inputs` configuration and uncomment this:
    #filebeat.autodiscover:
    #  providers:
    #    - type: kubernetes
    #      node: ${NODE_NAME}
    #      hints.enabled: true
    #      hints.default_config:
    #        type: container
    #        paths:
    #          - /var/log/containers/*${data.kubernetes.container.id}.log

    processors:
      - add_cloud_metadata:
      - add_host_metadata:

    cloud.id: ${ELASTIC_CLOUD_ID}
    cloud.auth: ${ELASTIC_CLOUD_AUTH}

    output.elasticsearch:
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      username: ${ELASTICSEARCH_USERNAME}
      password: ${ELASTICSEARCH_PASSWORD}

    logging.metrics.enabled: false
---

Upvotes: 0

Views: 2281

Answers (1)

Piotr Malec
Piotr Malec

Reputation: 3647

The filebeat.yml is configuration file that mounted at /etc/filebeat.yml in the filebeat DaemonSet.

There are directory layout and configuration reference pages for FileBeat in elastic.co documentation.

Update:

The logging.metrics.enabled: false will only disable internal metrics. Take a look at this post.

Note the difference between this INFO log for the internal metrics:

2019-03-26T16:16:02.557Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s

And the one in Your case:

2020-03-17T09:14:59.524Z        INFO    [monitoring]    log/log.go:118  Starting metrics logging every 30s

Unfortunately this configuration will not stop FileBeat from reporting metrics to ElasticSearch

Hope it helps.

Upvotes: 1

Related Questions