356.2.
ZipkinTracer zipkin = new ZipkinTracer(); // Configure a reporter, which controls how often spans are sent // (the dependency is io.zipkin.reporter2:zipkin-sender-okhttp3) sender = OkHttpSender.create("http://127.0.0.1:9411/api/v2/spans"); zipkin.setSpanReporter(AsyncReporter.create(sender)); // and then add zipkin to the CamelContext zipkin.init(camelContext);
<!-- configure how to reporter spans to a Zipkin collector (the dependency is io.zipkin.reporter2:zipkin-reporter-spring-beans) --> <bean id="http" class="zipkin2.reporter.beans.AsyncReporterFactoryBean"> <property name="sender"> <bean id="sender" class="zipkin2.reporter.beans.OkHttpSenderFactoryBean"> <property name="endpoint" value="http://localhost:9411/api/v2/spans"/> </bean> </property> <!-- wait up to half a second for any in-flight spans on close --> <property name="closeTimeout" value="500"/> </bean> <!-- setup zipkin tracer --> <bean id="zipkinTracer" class="org.apache.camel.zipkin.ZipkinTracer"> <property name="serviceName" value="dude"/> <property name="spanReporter" ref="http"/> </bean>
356.2.1.
zipkin.setServiceName("invoices");