【问题标题】:MeterRegistry IllegalArgumentExceptionMeterRegistry IllegalArgumentException
【发布时间】:2020-10-14 14:33:44
【问题描述】:

我正在使用 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, b, c, d, f].

这是什么原因造成的?如何解决?我正在使用

<dependency> 
<groupId>io.micrometer</groupId> 
<artifactId>micrometer-spring-legacy</artifactId> 
<version>1.3.2</version> 
</dependency>

【问题讨论】:

    标签: java spring-boot micrometer spring-micrometer


    【解决方案1】:

    我认为这是底层 prometheus 客户端的限制。单个指标的所有度量都必须具有相同的标签集。

    https://github.com/micrometer-metrics/micrometer/issues/877#issuecomment-425102772

    解决方案是确保该指标的所有测量值都包含相同的标签集。如果这不是一个选项,那么您可以考虑使用不同的指标后端。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-11
      • 1970-01-01
      • 2019-11-15
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多