ElasticSearch Metribeat,Kubernetes中的一些指标为空

问题描述

我正尝试使用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(不存在)。

因此,只有一些破折号有效,请参见:

enter image description here

请注意,吊舱数是错误的,由于kubernetes.deployment.replicas.available属性始终为0,因此为空。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)