Search in sources :

Example 6 with ZipkinTracer

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;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 7 with ZipkinTracer

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}");
}
Also used : ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 8 with ZipkinTracer

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;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 9 with ZipkinTracer

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;
}
Also used : CamelContext(org.apache.camel.CamelContext) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 10 with ZipkinTracer

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;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Aggregations

ZipkinTracer (org.apache.camel.zipkin.ZipkinTracer)11 CamelContext (org.apache.camel.CamelContext)8 ScribeSpanCollector (com.github.kristofa.brave.scribe.ScribeSpanCollector)7 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1