我们在这个项目上有一个微服务架构,我们使用Prometheus和Grafana进行监控。这些服务是使用Spring实现的,与Prometheus的集成是通过弹簧引导-执行器实现的.这个项目中有一些Kafka消费者,每个@KafkaListener spring都生成一些度量标准。下面是度量spring_kafka_listener_seconds_count的Prometheus时间序列的示例
spring_kafka_listener_seconds_count{exception="ListenerExecutionFailedException", instance="192.168.100.4:8001", job="spring-actuator", name="org.springframework.kafka.KafkaListenerEndpointContainer#0-0", result="failure"} 2
spring_kafka_listener_seconds_count{exception="none", instance="192.168.100.4:8001", job="spring-actuator", name="org.springframework.kafka.KafkaListenerEndpointContainer#0-0", result="success"} 2
spring_kafka_listener_seconds_count{exception="none", instance="192.168.100.4:8001", job="spring-actuator", name="org.springframework.kafka.KafkaListenerEndpointContainer#1-0", result="success"} 4org.springframework.kafka.KafkaListenerEndpointContainer#0-0 -没有给出很多关于@KafkaListener感兴趣的方法的信息。是否可以为这些指标的名称标签配置更有意义的值?
发布于 2022-02-10 15:37:55
给侦听器一个有意义的id。
@KafkaListener(id = "someId", ...)
注意,默认情况下,id将用作使用者group.id,除非您还指定了group,或者将idIsGroup设置为false。
https://stackoverflow.com/questions/71066728
复制相似问题