Prometheus通过JMX监控Apache Ignite

huangapple go评论93阅读模式
英文:

Prometheus monitoring for Apache Ignite via JMX

问题

我正在尝试使用Prometheus的JMX导出器来监视Apache Ignite,但我只看到默认的JVM指标以及仅针对"Thread Pools" Beans的指标。
JMX导出器作为代理运行:

/usr/bin/java -XX:+AggressiveOpts -javaagent:/etc/prometheus/jmx_prometheus_javaagent-0.13.0.jar=8080:/etc/prometheus/prometheus_config.yml -Xms1g -Xmx1g -server -XX:MaxMetaspaceSize=256m -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote.rmi.port=49112 -Djava.rmi.server.hostname=127.0.0.1 -DIGNITE_QUIET=true -DIGNITE_SUCCESS_FILE=/usr/share/apache-ignite/work/ignite_success_ed3b2798-4d48-4188-94ac-1728fa8628dc -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=49112 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DIGNITE_HOME=/usr/share/apache-ignite -DIGNITE_PROG_NAME=/usr/share/apache-ignite/bin/ignite.sh -cp /usr/share/apache-ignite/libs/*:/usr/share/apache-ignite/libs/ignite-indexing/*:/usr/share/apache-ignite/libs/ignite-spring/*:/usr/share/apache-ignite/libs/licenses/* org.apache.ignite.startup.cmdline.CommandLineStartup /etc/apache-ignite/default-config.xml

Ignite配置已启用指标:

<property name="metricExporterSpi">
    <list>
        <bean class="org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi"/>
    </list>
</property>

我可以从连接到49112端口的jconsole中看到大量的Ignite指标。
Prometheus通过JMX监控Apache Ignite

尝试了不同的jmx-exporter选项,没有帮助。

---
hostPort: 127.0.0.1:49112
lowercaseOutputLabelNames: true
lowercaseOutputName: true
---
lowercaseOutputLabelNames: true
lowercaseOutputName: true
rules:
- pattern: "^org.apache<clsLdr=(.+), name=sys"
  name: ignite_sys_stats
  help: Ignite集群堆内存量(字节)
  labels:
    attr: $3
  type: GAUGE

甚至是空的配置,应该意味着"收集一切如原样",但仍然只看到标准的JVM指标和"Thread Pools"。

你能提供一下这里有什么问题吗?

英文:

I'm trying to monitor Apache Ignite with Prometheus' JMX exporter, but I'm seeing only default JVM metrics plus metrics only for "Thread Pools" Beans.
JMX exporter run as agent:

/usr/bin/java -XX:+AggressiveOpts -javaagent:/etc/prometheus/jmx_prometheus_javaagent-0.13.0.jar=8080:/etc/prometheus/prometheus_config.yml -Xms1g -Xmx1g -server -XX:MaxMetaspaceSize=256m -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote.rmi.port=49112 -Djava.rmi.server.hostname=127.0.0.1 -DIGNITE_QUIET=true -DIGNITE_SUCCESS_FILE=/usr/share/apache-ignite/work/ignite_success_ed3b2798-4d48-4188-94ac-1728fa8628dc -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=49112 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DIGNITE_HOME=/usr/share/apache-ignite -DIGNITE_PROG_NAME=/usr/share/apache-ignite/bin/ignite.sh -cp /usr/share/apache-ignite/libs/*:/usr/share/apache-ignite/libs/ignite-indexing/*:/usr/share/apache-ignite/libs/ignite-spring/*:/usr/share/apache-ignite/libs/licenses/* org.apache.ignite.startup.cmdline.CommandLineStartup /etc/apache-ignite/default-config.xml

Ignite config has enables metrics:

&lt;property name=&quot;metricExporterSpi&quot;&gt;
    &lt;list&gt;
        &lt;bean class=&quot;org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi&quot;/&gt;
    &lt;/list&gt;
&lt;/property&gt;

I can see a lot of ignite metrics from jconsole connected to 49112 port.
Prometheus通过JMX监控Apache Ignite

Tried different jmx-exporter options, nothing helped.

---
hostPort: 127.0.0.1:49112
lowercaseOutputLabelNames: true
lowercaseOutputName: true
---
lowercaseOutputLabelNames: true
lowercaseOutputName: true
rules:
- pattern: &quot;^org.apache&lt;clsLdr=(.+), name=sys&quot;
  name: ignite_sys_stats
  help: Ignite cluster amount of heap memory in bytes
  labels:
    attr: $3
  type: GAUGE

and even empty config, that should mean "gather everything as is", still see just standard JVM + "Thread Pools".
Can you suggest what's wrong here ?

答案1

得分: 2

  1. 创建一个空的prometheus_config.yml文件。确保文件被正确读取。
    跟踪链接: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L75
    确保您正在使用正确的文件。

  2. 删除metricExporterSpi属性。

  3. 连接到指定的端口,在您的情况下是8080,以查看所有的结果。

您的模式匹配规则不允许Apache Ignite的结果正确显示。

您可以在这里使用调试/跟踪指令: https://github.com/prometheus/jmx_exporter
查看发生了什么。

模式规则处理在这里: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L357

英文:
  1. Create an empty prometheus_config.yml file. Make sure the file is properly read.
    Trace here: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L75
    to make sure you are using the correct file.

  2. remove the metricExporterSpi property

  3. connect to the port specified, 8080 in your case, to see all the results.

Your pattern matching rules are not allowing Apache Ignite results to show properly.

You can use debug/tracing instructions here: https://github.com/prometheus/jmx_exporter
to see what is happening.

pattern rule processing is here: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L357

huangapple
  • 本文由 发表于 2020年7月22日 19:56:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/63033626.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定