繁体   English   中英

指标在普罗米修斯中不可见

[英]Metrics not visible in prometheus

我正在使用弹性搜索导出器将弹性搜索指标拉到普罗米修斯。 我安装了 helm chart,可以通过端口转发查看http://127.0.0.1:9108/metrics上的指标。 但我没有看到普罗米修斯有任何指标。 有人可以告诉我从哪里开始解决问题吗?

TL; 博士

您尚未设置PodMonitorServiceMonitor
您需要根据prometheus-operator/Documentation#servicemonitor创建一个


您可以使用我的 helm chart kehao95/helm-prometheus-exporter来安装各种 prometheus 导出器,包括elasticsearch-exporter
它不仅会创建导出器Deployment ,还会为您创建Service / ServiceMonitor / PrometheusRule

  1. 安装图
helm repo add kehao95 https://kehao95.github.io/helm-prometheus-exporter
  1. 获取 elasticsearch-exporter 示例
wget https://raw.githubusercontent.com/kehao95/helm-prometheus-exporter/master/examples/elasticsearch-exporter.values.yaml
# or create a new one
helm show values kehao95/prometheus-exporter > elasticsearch-exporter.values.yaml
  1. 更新值文件中的 elasticsearch 连接信息。
  2. 带头盔安装
helm install -n monitoring elasticsearch-exporter kehao95/prometheus-exporter -f elasticsearch-exporter.values.yaml

解释

因为您可以通过导出器上的端口转发查看指标。 这意味着您有出口商工作。 但数据不会自动来到普罗米修斯。 您需要配置您的普罗米修斯以抓取导出器的指标端点。

prometheus-operator 中导出器的工作堆栈需要:

  • 导出器的Deployment (你已经有了)

  • 选择出口商的Service (取决于您使用的 Helm Chart,您可能也有)

  • ServiceMonitor以声明方式指定应如何监控 Kubernetes 服务组。 Operator 根据 API 服务器中对象的当前状态自动生成 Prometheus 抓取配置。

  • PrometheusRule定义了一组所需的 Prometheus 警报和/或记录规则。 Operator 生成一个规则文件,可供 Prometheus 实例使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM