我在为应用程序的2个示例创建指标时遇到问题。
HazelcastCacheMetrics.monitor(prometheusMeterRegistry, (IMap<?, ?>) cache.getNativeCache());
字符串
当我运行1个应用程序示例时,一切正常,但当我运行2个示例时,我出现错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastCacheMetricConfig': Invocation of init method failed; nested exception is 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 'cache_size' containing tag keys [cache, cacheManager, name]. The meter you are attempting to register has keys [cache].
型
或者当我将注册的指标更改为
@Autowired
private CacheMetricsRegistrar cacheMetricsRegistrar;
cacheMetricsRegistrar.bindCacheToRegistry(cache, Tag.of("instance", podName));
型
我有这个错误
Error creating bean with name 'hazelcastCacheMetricConfig': Invocation of init method failed; nested exception is 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 'cache_size' containing tag keys [cache, cacheManager, name]. The meter you are attempting to register has keys [cache, instance, name].
型
谢谢你帮我解决这个问题
1条答案
按热度按时间f8rj6qna1#
Hi使用MeterRegistryCustomizer而不是Hazelcast缓存
字符串