opentracing-contrib / opentracing-contrib/java-spring-cloud

Trace Span logs not appended to the loggers

Open
#318 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
399
Forks
143
Avg merge
1d 3h
Merged PRs (30d)
22

Description

HI,

Trace Logs are not appended in the logger file below is my configurations

opentracing.spring.web.client.enabled=true
opentracing.spring.cloud.log.enable=true
opentracing.zipkin.enabled=true
opentracing.zipkin.http-sender.url=http://localhost:9411
opentracing.zipkin.counting-sampler.rate=1.0

@Bean
public io.opentracing.Tracer globalTracer(){

    zipkin2.reporter.okhttp3.OkHttpSender okHttpSender = zipkin2.reporter.okhttp3.OkHttpSender.newBuilder()
            .encoding(Encoding.JSON)
            .endpoint("http://localhost:9411/api/v2/spans")
            .build();

    //zipkin2.reporter.brave.AsyncZipkinSpanHandler handler = zipkin2.reporter.brave.AsyncZipkinSpanHandler.create(okHttpSender);
    AsyncReporter<Span> reporter = AsyncReporter.builder(okHttpSender).build();

    brave.Tracing braveTracer = Tracing.newBuilder()
            .localServiceName(serviceName)
            .spanReporter(reporter)
            .addSpanHandler(new Log4jSpanHandler())
            .traceId128Bit(true)
            .sampler(Sampler.ALWAYS_SAMPLE)
            .build();
    return BraveTracer.create(braveTracer);
}

Above is my configurations the Spans are getting reported into Zipkin but those are not appended in the SLF4J Logs

Please could you let me know what setting need to be done to span logs append working...

Regards,
Rajesh Giriyappa

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the globalTracer bean and its Log4jSpanHandler configuration, then inspect how the configured tracer connects to SLF4J logging. Reproduce the setup with the listed Zipkin and sampling properties; done means spans continue reaching Zipkin and are also appended to the logger output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.