目前我正在使用Spring Boot 2.1,Spring Kafka(2.2.0)和Micrometer(1.1.0).
我创建了一个简单的示例项目,包含:
我的目标是让Kakfa消费者指标工作,作为千分尺1.1.0的一部分发布.
生成和使用Hello World消息的工作完全正常(kafka)指标暴露在http:// host:port/actuator/metrics但是当我请求特定的Kafka指标时:
HTTP://主机:端口/致动器/度量/ kafka.consumer.records.consumed.total
统计的价值COUNT是NaN.
{
name: "kafka.consumer.records.consumed.total",
description: "The total number of records consumed.",
baseUnit: "records",
measurements: [
{
statistic: "COUNT",
value: "NaN"
}
],
availableTags: [
{
tag: "client.id",
values: [
"spring-kafka-consumer-hello-world-app"
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
我是否忽略了Spring Boot应用程序或Kafka代理的某些配置?我希望你能指出我正确的方向.
你可以在这里找到我的示例项目.