【问题标题】:How to use Prometheus' JMX exporter java agent to collect custom metrics如何使用 Prometheus 的 JMX exporter java 代理来收集自定义指标
【发布时间】:2018-06-26 08:55:40
【问题描述】:

我想使用 Prometheus 的 JMX 导出器来收集使用 Prometheus 的自定义应用程序指标。我有一个应用程序,我已经打包到一个 jar 文件ApplicationToMonitor.jar - 它公开端口 8989 并声明 Prometheus 指标,但没有公开 prometheus 抓取的端点(从我读过的内容来看,prometheus javaagent 负责这个)。

我不确定configuration.yaml 文件应该是什么样子。另外,为什么建议使用shaded.io.prometheus 库(并在默认注册表下注册新的度量变量)而不是常规的io.prometheus 库而不使用注册表?

我引用的是Prometheus JMX exporter documentation,只是不理解上述组件。

【问题讨论】:

    标签: java jmx prometheus


    【解决方案1】:

    您只能将 JMX 导出器用于您无法控制的公开 JMX 指标的代码。在这种情况下,您需要为每个 https://github.com/prometheus/client_java#http 添加一些说明。 HTTPServer 最简单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-15
      • 2020-09-13
      • 2020-11-04
      • 1970-01-01
      • 2022-11-04
      • 2020-11-14
      • 1970-01-01
      • 2021-05-30
      相关资源
      最近更新 更多