英文:
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指标。
尝试了不同的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:
<property name="metricExporterSpi">
<list>
<bean class="org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi"/>
</list>
</property>
I can see a lot of ignite metrics from jconsole connected to 49112 port.
Tried different jmx-exporter options, nothing helped.
---
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 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
-
创建一个空的prometheus_config.yml文件。确保文件被正确读取。
跟踪链接: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java#L75
确保您正在使用正确的文件。 -
删除metricExporterSpi属性。
-
连接到指定的端口,在您的情况下是8080,以查看所有的结果。
您的模式匹配规则不允许Apache Ignite的结果正确显示。
您可以在这里使用调试/跟踪指令: https://github.com/prometheus/jmx_exporter
查看发生了什么。
英文:
-
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. -
remove the metricExporterSpi property
-
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论