kubernetes中某些度量为空的elasticsearch metribeat

cyej8jka  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(0)|浏览(259)

我尝试使用metricbeat从kubernetes收集一些度量,为此,我使用以下部署文件:https://gist.github.com/rlanhellas/5e52bf7a2af4f754111ed3412820b0dc.
在我的应用程序部署中,我添加了以下注解:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-deploy
  namespace: general
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
      annotations:
        co.elastic.logs/enabled: 'true'
        co.elastic.logs/json.keys_under_root: 'true'
        co.elastic.logs/json.add_error_key: 'true'
        co.elastic.logs/json.message_key: 'message'
        co.elastic.metrics/module: 'prometheus'
        co.elastic.metrics/metricsets: 'collector'
        co.elastic.metrics/hosts: '${data.host}:9090'
        co.elastic.metrics/period: '1m'

但是在kibana中,metricbeat收集的一些字段是空的:kubernetes.pod.cpu.usage.nanocores、kubernetes.deployment.replicas.available(不存在)。
正因为如此,一些破折号才起作用,看看吧:

请注意,pod的数量是错误的,始终为0,因为kubernetes.deployment.replicas.available属性为空。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题