OpenTracing+;Jaeger:未报告SQL跟踪

OpenTracing+;Jaeger:未报告SQL跟踪,jaeger,opentracing,Jaeger,Opentracing,我遵循此处提到的所有说明: 我假设通过这些步骤,与JDBC操作相关的跟踪将自动开始报告。然而,在日志中,我只在下面看到了这一点,而在Jaeger UI中没有看到任何内容 [main] INFO io.jaegertracing.Configuration - Initialized tracer=JaegerTracer(version=Java-0.35.4, serviceName=my-svc, reporter=CompositeReporter(reporters=[RemoteRep

我遵循此处提到的所有说明:

我假设通过这些步骤,与JDBC操作相关的跟踪将自动开始报告。然而,在日志中,我只在下面看到了这一点,而在Jaeger UI中没有看到任何内容

[main] INFO io.jaegertracing.Configuration - Initialized tracer=JaegerTracer(version=Java-0.35.4, serviceName=my-svc, reporter=CompositeReporter(reporters=[RemoteReporter(sender=HttpSender(), closeEnqueueTimeout=1000), LoggingReporter(logger=org.slf4j.impl.SimpleLogger(io.jaegertracing.internal.reporters.LoggingReporter))]), sampler=ConstSampler(decision=true, tags={sampler.type=const, sampler.param=true}), tags={hostname=mypc.local, jaeger.version=Java-0.35.4, ip=127.0.0.1}, zipkinSharedRpcSpan=false, expandExceptionLogs=false, useTraceId128Bit=false)
有人能举例说明如何做到这一点吗?我正在使用以下版本:

opentracing-api-0.33.0 opentracing-jdbc-0.2.10 opentracing-util-0.33.0 jaeger-core-0.35.4

这是我尝试过的摘要。还有什么我需要做的吗

// Jaeger Tracer
private static Tracer tracer = initTracer();

…

public static Tracer initTracer() {
    try {
        Class.forName("com.mysql.jdbc.Driver");
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }


    System.setProperty("JAEGER_ENDPOINT", "http://collector-hostt:14268/api/traces");

    TracingDriver.load();
    TracingDriver.setInterceptorMode(true);
    TracingDriver.setInterceptorProperty(true);
    TracingDriver.setTraceEnabled(true);

    SamplerConfiguration samplerConfig = SamplerConfiguration
            .fromEnv()
            .withType(ConstSampler.TYPE)
            .withParam(1);

    ReporterConfiguration reporterConfig = ReporterConfiguration
            .fromEnv()
            .withLogSpans(true);

    Configuration config = new Configuration("my-svc")
            .withSampler(samplerConfig)
            .withReporter(reporterConfig);

    tracer = config.getTracer();

    GlobalTracer.registerIfAbsent(tracer);

    return tracer;
}
下面是关于数据库调用的代码:

Span span = tracer.buildSpan("getAuthAccount").start();
span.setTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT);
this.accountDao.getAccount(username, password);
span.finish();
数据库配置为:

<Context>
    <Resource name="jdbc/myDB"
        type="javax.sql.DataSource" auth="Container"
        maxActive="100" maxIdle="30" maxWait="10000"
        username="tcuser" password="quality"
        driverClassName="io.opentracing.contrib.jdbc.TracingDriver"
        url="jdbc:tracing:mysql://localhost:3306/mydb?autoReconnect=true&amp;traceWithActiveSpanOnly=true"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
        minEvictableIdleTimeMillis="60000"
        timeBetweenEvictionRunsMillis="60000"
        testOnBorrow="true" testOnReturn="false" testWhileIdle="true"
        validationInterval="1800000" validationQuery="SELECT 1"/>
</Context>


你解决了吗?如果是,你能发布正确的配置吗?你能发布正确的答案吗?我也遇到了同样的问题