gpt4 book ai didi

java - 向 jaeger 代理发送跟踪时出现问题

转载 作者:太空宇宙 更新时间:2023-11-04 09:24:41 31 4
gpt4 key购买 nike

我正在尝试在 jaeger 中获取 mongo 日志。基本上我希望我的 jaeger 显示我的 mongo 应用程序错误。执行此操作的最佳方法是什么?

我尝试使用maven repo-opentracing-mongo-driver(版本0.1.4)

在我的代码中,我使用 -

配置了它
@Bean
public Tracer jaegerTracer() {
Tracer tracer = jaegerTracer();

MongoSpanNameProvider customNameProvider;
TracingCommandListener listener = new TracingCommandListener.Builder(tracer).build();

MongoClient mongoClient = MongoClients.create(
MongoClientSettings.builder()
.addCommandListener(listener)
.build());



//MongoClient mongoClient = new TracingMongoClient(tracer, "http://localhost:27017");
//TracingCommandListener listener = new TracingCommandListener.Builder(tracer).build();
return new Configuration("spring-boot", new Configuration.SamplerConfiguration(ProbabilisticSampler.TYPE, 1),
new Configuration.ReporterConfiguration())
.getTracer();
}

但是我收到了这个错误-

java.lang.AbstractMethodError: Receiver class io.opentracing.noop.NoopSpanBuilderImpl does not define or inherit an implementation of the resolved method abstract startActive(Z)Lio/opentracing/Scope; of interface io.opentracing.Tracer$SpanBuilder.
at io.opentracing.contrib.web.servlet.filter.TracingFilter.doFilter(TracingFilter.java:156) ~[opentracing-web-servlet-filter-0.1.0.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.22.jar:9.0.22]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

我做错了什么?

最佳答案

您很可能与您的 OpenTracing 库不匹配。您的 Servlet Filter 集成 (io.opentracing.contrib.web.servlet.filter.TracingFilter) 似乎正在使用不存在的方法。

关于java - 向 jaeger 代理发送跟踪时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57870219/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com