简体   繁体   English

Prometheus 通过 JMX 监控 Apache Ignite

[英]Prometheus monitoring for Apache Ignite via JMX

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.我正在尝试使用 Prometheus 的 JMX 导出器监控 Apache Ignite,但我只看到默认的 JVM 指标以及“线程池”Bean 的指标。 JMX exporter run as agent: 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 config has enables metrics: Ignite 配置启用了指标:

<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.我可以从连接到 49112 端口的 jconsole 中看到很多 ignite 指标。 控制台

Tried different jmx-exporter options, nothing helped.尝试了不同的 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 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".甚至空配置,这应该意味着“按原样收集所有内容”,仍然只看到标准 JVM +“线程池”。 Can you suggest what's wrong here?你能建议这里有什么问题吗?

  1. Create an empty prometheus_config.yml file.创建一个空的 prometheus_config.yml 文件。 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.在此处跟踪: https://github.com/prometheus/jmx_exporter/blob/ce04b7dca8615d724d8f447fa25c44ae1c29238b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java文件#L75

  2. remove the metricExporterSpi property删除 metricExporterSpi 属性

  3. connect to the port specified, 8080 in your case, to see all the results.连接到指定的端口,在您的情况下为 8080,以查看所有结果。

Your pattern matching rules are not allowing Apache Ignite results to show properly.您的模式匹配规则不允许 Apache Ignite 结果正确显示。

You can use debug/tracing instructions here: https://github.com/prometheus/jmx_exporter to see what is happening.您可以在此处使用调试/跟踪指令: https://github.com/prometheus/jmx_exporter查看发生了什么。

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

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

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