如何解决MeterRegistry IllegalArgumentException
我正在使用MeterReigstry推送要由Prometheus轮询的指标。但是,当我添加动态代码时,出现以下异常:
java.lang.IllegalArgumentException: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'execution_time_seconds' containing tag keys [a,e,b,c,d]. The meter you are attempting to register has keys [a,d,f].
是什么原因造成的?如何解决?我正在使用
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-spring-legacy</artifactId>
<version>1.3.2</version>
</dependency>
解决方法
我认为这是来自底层Prometheus客户的限制。单个指标的所有测量结果都必须具有相同的标签集。
https://github.com/micrometer-metrics/micrometer/issues/877#issuecomment-425102772
解决方案将是确保该度量的所有度量都包含相同的标签集。如果这不是一种选择,那么您可能会考虑使用其他指标后端。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。