use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class ZipkinABCRouteScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
zipkin.addClientServiceMapping("seda:a", "a");
zipkin.addClientServiceMapping("seda:b", "b");
zipkin.addClientServiceMapping("seda:c", "c");
zipkin.addServerServiceMapping("seda:a", "a");
zipkin.addServerServiceMapping("seda:b", "b");
zipkin.addServerServiceMapping("seda:c", "c");
zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
// attaching ourself to CamelContext
zipkin.init(context);
return context;
}
use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class Service2Route method configure.
@Override
public void configure() throws Exception {
// create zipkin
ZipkinTracer zipkin = new ZipkinTracer();
zipkin.setHostName("192.168.99.100");
zipkin.setPort(9410);
// set the service name
zipkin.setServiceName("service2");
// capture 100% of all the events
zipkin.setRate(1.0f);
// include message bodies in the traces (not recommended for production)
zipkin.setIncludeMessageBodyStreams(true);
// add zipkin to CamelContext
zipkin.init(getContext());
from("undertow:http://0.0.0.0:7070/service2").routeId("service2").streamCaching().log(" Service2 request: ${body}").delay(simple("${random(1000,2000)}")).transform(simple("Service2-${body}")).log("Service2 response: ${body}");
}
use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class ZipkinTimerRouteScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
// we have one route as service
zipkin.addClientServiceMapping("seda:timer", "timer");
zipkin.addServerServiceMapping("seda:timer", "timer");
zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
// attaching ourself to CamelContext
zipkin.init(context);
return context;
}
use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class ZipkinAutoConfigureScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
// we have one route as service
zipkin.addClientServiceMapping("seda:cat", "cat");
zipkin.addServerServiceMapping("seda:cat", "cat");
// should auto configure as we have not setup a spanCollector
// attaching ourself to CamelContext
zipkin.init(context);
return context;
}
use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class ZipkinMulticastRouteScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
zipkin.addClientServiceMapping("seda:a", "a");
zipkin.addClientServiceMapping("seda:b", "b");
zipkin.addClientServiceMapping("seda:c", "c");
zipkin.addServerServiceMapping("seda:a", "a");
zipkin.addServerServiceMapping("seda:b", "b");
zipkin.addServerServiceMapping("seda:c", "c");
zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
// attaching ourself to CamelContext
zipkin.init(context);
return context;
}
Aggregations