'Java Brave: .spanReporter() deprecated in Tracing.newBuilder().localServiceName("service").spanReporter(reporter).build();

Small question regarding Java Brave please.

I have a very small piece of code:

OkHttpSender        sender   = OkHttpSender.newBuilder().endpoint("https://zipkin-instance.com:9411/api/v2/spans").build();
AsyncReporter<Span> reporter = AsyncReporter.builder(sender).build();
Tracing             tracing  = Tracing.newBuilder().localServiceName("service").spanReporter(reporter).build();

The code is working fine, but after a version bump:

 <dependency>
            <groupId>io.opentracing.brave</groupId>
            <artifactId>brave-opentracing</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.reporter2</groupId>
            <artifactId>zipkin-sender-okhttp3</artifactId>
            <version>2.16.3</version>
        </dependency>

I am seeing this being deprecated: .spanReporter(reporter)

Looking at the documentation, I am not able to see what is this deprecated in favor of.

May I ask what is the new equivalent of this please?

OkHttpSender        sender   = OkHttpSender.newBuilder().endpoint("https://zipkin-instance.com:9411/api/v2/spans").build();
AsyncReporter<Span> reporter = AsyncReporter.builder(sender).build();
Tracing             tracing  = Tracing.newBuilder().localServiceName("service").spanReporter(reporter).build();

Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source