如何发送字符串 JMX 指标?

发布于 2025-01-13 02:30:07 字数 2042 浏览 4 评论 0原文

我正在使用一个 Java 应用程序,该应用程序通过 JMX 发送指标,配置如下:

instances:
  - host: localhost
    port: 9999
    conf:
      - include:
          domain: 'debezium.postgres'

大多数指标发送时没有任何问题,但是仪表板中缺少一些指标。

代理日志:

2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkId: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkFrom: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkTo: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - TableFrom: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - TableTo: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - LastEvent: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=streaming,server=xxxx - SourceEventPosition: java.lang.NumberFormatException: For input string: "lsn"
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=streaming,server=xxxx - LastEvent: java.lang.NumberFormatException: For input string: "position: {lsn: 949416252032}, key: {"id" : "89845"}"

这些指标以 String 形式发送,但 Datadog 似乎只能理解 Integer 类型的指标...

有没有办法将代理配置为发送字符串指标?

I am using a Java application that is sending metrics trough JMX with the following config :

instances:
  - host: localhost
    port: 9999
    conf:
      - include:
          domain: 'debezium.postgres'

Most of the metrics are sent without any issue, however there are some metrics that are missing in the dashboard.

Agent logs :

2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkId: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkFrom: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - ChunkTo: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - TableFrom: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - TableTo: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=snapshot,server=xxxx - LastEvent: java.lang.NumberFormatException
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=streaming,server=xxxx - SourceEventPosition: java.lang.NumberFormatException: For input string: "lsn"
2022-03-10 05:14:22 GMT | JMX | WARN | JmxAttribute | Unable to get metrics from debezium.postgres:type=connector-metrics,context=streaming,server=xxxx - LastEvent: java.lang.NumberFormatException: For input string: "position: {lsn: 949416252032}, key: {"id" : "89845"}"

Those metrics are sent as String, but it seems that Datadog can only understand Integer type metrics ...

Is there a way to configure the agent to sent string metrics ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文