JMX出口商和Prometheus [英] JMX exporter and Prometheus

查看:172
本文介绍了JMX出口商和Prometheus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有这些问题都是问题此处

到现在,我已经在节点x214上运行了单节点kafka代理,并在端口7071上使用jmx导出器报告了其报告指标

by now i have single node kafka broker running on node x214 and its reporting metrics using jmx exporter on port 7071

curl -s localhost:7071 | grep -i kafka
# reports many metrics on std out

我想将jmx导出器与Prometheus连接起来,并最终连接到grafana以进行可视化;如此处

i want to connect jmx exporter with Prometheus and eventually to grafana for visualization; as described here

我尝试按照博客的说明安装Prometheus,但遇到了问题;我发现使用docker容器

i tried installing Prometheus as blogs explains but running into issues; i find launching Prometheus easy with docker container as

docker run -p 9090:9090 -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

我在节点x215(与kafka代理不同的节点)上运行Prometheus.我可以在 http://x215-ip:9090

I am running Prometheus on node x215 (different node than kafka broker). i can reach to Prometheus gui on http://x215-ip:9090

prometheus.yaml文件设置为以下文件.

prometheus.yaml file is set to following.

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus_master'
    scrape_interval: 5s
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['IP-215:9090']
  - job_name: ‘kafka-server’
    static_configs:
      - targets: [‘IP-214:7071’]

问题:-在Prometheus gui上,我找不到任何kafka指标;如上面的 curl 命令的响应

Issue :- on Prometheus gui i cant find any kafka metrics; as visible in response of curl command above

指标页面(IP-215:9090/metrics)的响应为此处

response of metrics page (IP-215:9090/metrics) is here

我认为JMX导出器正确报告了度量标准,但未正确连接到Prometheus.你能在这里帮我吗?

i feel that JMX exporter is reporting metrics correctly but its not connected to Prometheus correctly. can you help me here?

谢谢

推荐答案

我们需要更多信息来帮助确定此处发生的情况.您可以分享以下内容吗?

We need a little more information to help determine what's going on here. Can you share the following:

  • JMX导出器的绑定接口(正在侦听0.0.0.0、127.0.0.1或其他特定接口吗?)可以使用 ss -plunt |grep -i jmx
  • prometheus实例可以通过网络访问JMX Exporter实例吗?鉴于它们位于不同的计算机上,因此可能会有很多事情发生(防火墙,网络配置,SDN,IPtables ...等等).prometheus容器确实具有telnet,因此最简单的方法是使用它来查看是否可以连接到端口7071. docker exec -it prometheus sh 并运行 telnet IP-214:7071 .您也许也可以卷曲,但是在普罗米修斯图像中无法使用卷曲.
  • the bound interface for JMX exporter (is it listening on 0.0.0.0, 127.0.0.1, or some other specific interface?) This can be checked with something like ss -plunt | grep -i jmx
  • can the prometheus instance access the JMX Exporter instance over the network? Given that they're on different machines, there are numerous things that could come in the way (Firewalls, Network Configuration, SDN, IPtables... to name a few). The prometheus container does have telnet, so it's easiest to just use that to see if you can connect to port 7071. docker exec -it prometheus sh and run telnet IP-214:7071. You may also be able to curl, but curl is not available in the prometheus image.

同时检查这两个方面可以帮助排除配置中的一些简单问题.

Checking both of these can help rule out some simple problems in your configuration.

这篇关于JMX出口商和Prometheus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆