创建Spring Cloud Sleuth对应Zipkin服务,引入依赖:

<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
<version>2.12.3</version>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<version>2.12.3</version>
</dependency>

properties文件:

server.port=8083

spring.application.name=DEMO-ZIPKIN

# consul
spring.cloud.consul.host=127.0.0.1
spring.cloud.consul.port=8500

启动类中加入@EnableZipkinServer

服务启动成功,但是在访问时(http://localhost:8083)出现以下错误:

2019-08-29 23:23:58.120 ERROR 60481 --- [  XNIO-1 task-2] io.undertow.request                      : UT005023: Exception handling request to /favicon.ico

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 'http_server_requests_seconds' containing tag keys [method, status, uri]. The meter you are attempting to register has keys [exception, method, outcome, status, uri].
at io.micrometer.prometheus.PrometheusMeterRegistry.lambda$collectorByName$9(PrometheusMeterRegistry.java:372) ~[micrometer-registry-prometheus-1.1.5.jar:1.1.5]
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1877) ~[na:1.8.0_191]
at io.micrometer.prometheus.PrometheusMeterRegistry.collectorByName(PrometheusMeterRegistry.java:359) ~[micrometer-registry-prometheus-1.1.5.jar:1.1.5]
at io.micrometer.prometheus.PrometheusMeterRegistry.newTimer(PrometheusMeterRegistry.java:165) ~[micrometer-registry-prometheus-1.1.5.jar:1.1.5]
at io.micrometer.core.instrument.MeterRegistry.lambda$timer$2(MeterRegistry.java:270) ~[micrometer-core-1.1.5.jar:1.1.5]
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:575) ~[micrometer-core-1.1.5.jar:1.1.5]
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:528) ~[micrometer-core-1.1.5.jar:1.1.5]
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:268) ~[micrometer-core-1.1.5.jar:1.1.5]
at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:464) ~[micrometer-core-1.1.5.jar:1.1.5]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.stop(WebMvcMetricsFilter.java:180) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.record(WebMvcMetricsFilter.java:169) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:130) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) ~[spring-web-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) ~[spring-web-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) [undertow-servlet-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) [undertow-core-2.0.23.Final.jar:2.0.23.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-2.0.23.Final.jar:2.0.23.Final]
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) [jboss-threads-2.3.2.Final.jar:2.3.2.Final]
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) [jboss-threads-2.3.2.Final.jar:2.3.2.Final]
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) [jboss-threads-2.3.2.Final.jar:2.3.2.Final]
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) [jboss-threads-2.3.2.Final.jar:2.3.2.Final]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

解决方法:

在配置文件中加入:management.metrics.web.server.auto-time-requests=false

源码MetricsProperties类中的内部类:

-----------------------------------

参考地址:https://github.com/openzipkin/zipkin/issues/2043

java.lang.IllegalArgumentException: Prometheus requires that all meters with the same name have the same set of tag keys.的更多相关文章

  1. 【异常】Zipkin server 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 containing tag keys [meth

    解决办法: 添加下面配置就OK #zipkin启动报错无法访问的解决方法 management.metrics.web.server.auto-time-requests: false

  2. 【spring cloud】spring cloud集成zipkin报错:Prometheus requires that all meters with the same name have the same set of tag keys.

    spring boot 2.0.X 的版本,整合zipkin2.10.1 zipkin服务启动后,访问zipkin的UI http://localhost:8002/zipkin/ 页面显示空白,cs ...

  3. Caused by: java.lang.IllegalArgumentException: DefaultSerializer requires a Serializable payload but received an object of type [VCodeModel]

    2019-08-20 17:53:24,054 [ERROR] [http-nio-8047-exec-1] [HttpResult.java : 143] 系统异常 org.springframew ...

  4. hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///

    Java代码如下: FileSystem fs = FileSystem.get(conf); in = fs.open(new Path("hdfs://192.168.130.54:19 ...

  5. 严重: Error starting static Resources java.lang.IllegalArgumentException:

    严重: Error starting static Resources java.lang.IllegalArgumentException: Document base E:\myworkspace ...

  6. Eclipse启动Tomcat时发生java.lang.IllegalArgumentException: <session-config> element is limited to 1 occurrence

    在学习struts 2时,为了方便,直接从下载的struts的apps目录下的struts2-blank.war压缩包下的WEB-INF\复制的web.xml,当我启动Tomcat时,发生 java. ...

  7. tomcat报错java.lang.IllegalArgumentException: Document base XXXXX does not exist or is not a readable directory

    启动tomcat的时候报如下错误: java.lang.IllegalArgumentException: Document base F:\java\tools\tomcat\me-webapps\ ...

  8. java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required

    java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required 严重: Exceptio ...

  9. java.lang.IllegalArgumentException: Illegal character in query at index 261

    在BaseFragment中使用了LoadingPage,而LoadingPage的联网加载使用的是AsyncHttpClient.一直报java.lang.IllegalArgumentExcept ...

随机推荐

  1. Python 中運算子 + 與 * 的 Overload 方法重載功能

    字串 String 原本不能像數值一樣有加減乘除運算,但有例外.例如: >>> 'Good' + 'Morning''GoodMorning' 運算子 + 可將2個字串,串接起來. ...

  2. 033.[转] Java 工程师成神之路 | 2019正式版

    Java 工程师成神之路 | 2019正式版 原创: Hollis Hollis 2月18日 https://mp.weixin.qq.com/s/hlAn6NPR1w-MAwqghX1FPg htt ...

  3. 以特定用户和组来执行某个程序 - linux

    运行cockpit 服务时,我们指定运行此程序的用户和组:cockpit-ws cockpit-ws 我们使用 sudo -u -g 命令来进行运行: sudo -u cockpit-ws -g co ...

  4. Centos7.6 Apache 虚拟机禁止访问IP,允许访问多域名多个虚拟目录设置

    存放配置文件路径 /etc/httpd/conf.d自定义命名,配置文件后缀格式确保 *.conf注:这是两个配置文件,也是两种方法. # 一个WEB目录# 禁止以IP地址形式访问<Virtua ...

  5. 007.MongoDB特殊成员

    一 MongoDB成员 1.1 常见特殊member Secondary存在一些特殊的成员类型: Priority 0 #不能升为主,可以用于多数据中心场景 Hidden #对客户端来说是不可见的,一 ...

  6. JavaScript调用mysql查询bigint数据精度失真解决方案

    最近我遇上了如题这个问题,后端用node.js写了一个读取mysql数据的接口,之前使用了很久都没发现什么问题,在查询订单表的订单ID时返回的值却是错的 正确的值是 19102818002800002 ...

  7. 0day2安全——笔记3

    第二章 函数调用约定 不同的操作系统,语言和编译器调用函数的原理差不多,但是具体的调用约定有差异. C语言VC++编译的函数传参顺序如下图所示(默认使用__stdcall调用约定) 函数调用步骤(__ ...

  8. leetcode 双周赛9 进击的骑士

    一个坐标可以从 -infinity 延伸到 +infinity 的 无限大的 棋盘上,你的 骑士 驻扎在坐标为 [0, 0] 的方格里. 骑士的走法和中国象棋中的马相似,走 “日” 字:即先向左(或右 ...

  9. JVM的类加载过程以及双亲委派模型详解

    JVM的类加载过程以及双亲委派模型详解 这篇文章主要介绍了JVM的类加载过程以及双亲委派模型详解,类加载器就是根据指定全限定名称将 class 文件加载到 JVM 内存,然后再转化为 class 对象 ...

  10. AHOI 2009 维护序列

    洛谷 P2023 [AHOI2009]维护序列 洛谷传送门 题目描述 老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成. 有长为N的数列,不妨设为a1,a2,-,aN .有如下三种操作形式 ...