1

我正在尝试将 jvm 指标集成到我的 akka 应用程序中。我使用了 prometheus jmx exporter。我没有使用整个应用程序并将其作为 java 代理运行,而是仅使用了导出器并集成到我现有的 prometheus 注册表中

import io.prometheus.jmx.JmxCollector

val jmxCollector: JmxCollector = new JmxCollector(getClass.getResourceAsStream("jmx-config.yaml"))
jmxCollector.register(prometheusRegistry)

我能够看到指标,但与将导出器作为 Java 代理运行的其他应用程序相比,缺少以前缀 jvm 开头的指标。就像缺少的线程指标

# HELP jvm_threads_state Current count of threads by state
# TYPE jvm_threads_state gauge
jvm_threads_state{state="TERMINATED",} 0.0
jvm_threads_state{state="RUNNABLE",} 10.0
jvm_threads_state{state="TIMED_WAITING",} 11.0
jvm_threads_state{state="WAITING",} 37.0
jvm_threads_state{state="NEW",} 0.0
jvm_threads_state{state="BLOCKED",} 0.0

我的指标配置是最低限度的,在两个应用程序中看起来都是这样

---
startDelaySeconds: 10
ssl: false
lowercaseOutputName: false
lowercaseOutputLabelNames: false

您能否帮助我了解导致此问题的差异可能是什么。

4

0 回答 0