[英]How do i enable Prometheus/Grafana to show my rabbitmq metrics ? It currently shows no data
I am using the prometheus-community stack.我正在使用普罗米修斯社区堆栈。
I have a rabbitmq pod running in my K8s cluster, I have enabled rabbitmq_prometheus from within the pod so I am able to see the time series data of of my rabbitmq from localhost:15692.我有一个 rabbitmq pod 在我的 K8s 集群中运行,我在 pod 中启用了 rabbitmq_prometheus,因此我可以从 localhost:15692 看到我的 rabbitmq 的时间序列数据。 I have also installed a dashboard in grafana (this enter link description here ) in order to be able to see this data.我还在 grafana 中安装了一个仪表板(在此处输入链接描述),以便能够查看此数据。 However I get No Data showing in my RabbitMQ dashboard.但是,我的 RabbitMQ 仪表板中没有显示任何数据。 as shown below.如下所示。 . .
I have also installed prometheus-community/prometheus-rabbitmq-exporter, saved the values file locally so that i can make changes to it, currently it looks like this below我还安装了 prometheus-community/prometheus-rabbitmq-exporter,将值文件保存在本地,以便我可以对其进行更改,目前如下所示
prometheus:
monitor:
enabled: true
additionalLabels: {}
interval: 15s
namespace: []
rules:
enabled: false
additionalLabels: {}
I have applied the values file to my helm release however when i do an inspect on it, i still get enabled: false I am not sure what I am missing or doing wrong.我已将值文件应用于我的 helm 版本,但是当我对其进行检查时,我仍然可以启用:false我不确定我遗漏了什么或做错了什么。
How do i show my rabbitmq metrics in grafana?如何在 grafana 中显示我的 rabbitmq 指标?
I've not really understood the steps you took to make it work, but I understand your problem is not being able to import RabbitMQ metrics in Prometheus.我还没有真正理解您为使其工作而采取的步骤,但我理解您的问题是无法在 Prometheus 中导入 RabbitMQ 指标。 So here's the solution.所以这是解决方案。
1.Deploy prometheus using kube-prometheus-stack
helm chart . 1.使用kube-prometheus-stack
helm chart部署 prometheus。 As the helm chart comes with "prometheus operator", it's best to use PodMonitor and/or ServiceMonitor CRD's as they provide far more configuration options.由于 helm chart 带有“prometheus operator”,因此最好使用 PodMonitor 和/或 ServiceMonitor CRD,因为它们提供了更多的配置选项。 Here's some documentation around that. 这里有一些关于它的文档。
Keep default values (as the purpose is just to import RabbitMQ metrics) for most of the stuff, except that set "prometheus.prometheusSpec.serviceMonitorSelector.matchLabels"
with a label value.保留大多数东西的默认值(因为目的只是导入 RabbitMQ 指标),除了将"prometheus.prometheusSpec.serviceMonitorSelector.matchLabels"
设置为 label 值。 Something like this像这样的东西
serviceMonitorSelector:
matchLabels:
monitoring-platform: core-prometheus
2.Deploy RabbitMQ using the bitnami rabbitmq helm chart . 2.使用bitnami rabbitmq helm chart部署RabbitMQ。 Again, as the purpose here is just to expose metrics for prometheus to scrape, you can use default values for much of it.同样,由于此处的目的只是公开指标以供 prometheus 抓取,因此您可以在其中大部分使用默认值。 Here's the values file:这是值文件:
## Prometheus Metrics
metrics:
enabled: true
plugins: 'rabbitmq_prometheus'
podAnnotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '{{ .Values.service.metricsPort }}'
## Prometheus Service Monitor
## ref: https://github.com/coreos/prometheus-operator
serviceMonitor:
enabled: true
interval: 30s
additionalLabels:
monitoring-platform: core-prometheus
So using the serviceMonitor
label (which matches the label of prometheus serviceMonitorSelector
) Prometheus identifies RabbitMQ as a target.因此,使用serviceMonitor
label (与 prometheus serviceMonitorSelector
的 label 匹配)Prometheus 将 RabbitMQ 识别为目标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.