如何发送字符串 JMX 指标?
我正在使用一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论