use of org.apache.camel.zipkin.ZipkinTracer in project camel by apache.
the class ZipkinOneRouteFallbackScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
// no service so should use fallback naming style
// we do not want to trace any direct endpoints
zipkin.addExcludePattern("direct:*");
zipkin.setIncludeMessageBody(true);
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 ZipkinOneRouteScribe 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");
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 ZipkinSimpleRouteScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
// we have one route as service
zipkin.addClientServiceMapping("seda:dude", "dude");
zipkin.addServerServiceMapping("seda:dude", "dude");
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 ZipkinTwoRouteScribe method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
zipkin = new ZipkinTracer();
// we have 2 routes as services
zipkin.addClientServiceMapping("seda:cat", "cat");
zipkin.addServerServiceMapping("seda:cat", "cat");
zipkin.addClientServiceMapping("seda:dog", "dog");
zipkin.addServerServiceMapping("seda:dog", "dog");
// capture message body as well
zipkin.setIncludeMessageBody(true);
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 ZipkinAutoConfiguration method zipkinEventNotifier.
@Bean(initMethod = "", destroyMethod = "")
// Camel handles the lifecycle of this bean
@ConditionalOnMissingBean(ZipkinTracer.class)
ZipkinTracer zipkinEventNotifier(CamelContext camelContext, ZipkinConfigurationProperties config) {
ZipkinTracer zipkin = new ZipkinTracer();
zipkin.setHostName(config.getHostName());
zipkin.setPort(config.getPort());
zipkin.setRate(config.getRate());
if (ObjectHelper.isNotEmpty(config.getServiceName())) {
zipkin.setServiceName(config.getServiceName());
}
if (config.getExcludePatterns() != null) {
zipkin.setExcludePatterns(config.getExcludePatterns());
}
if (config.getClientServiceMappings() != null) {
zipkin.setClientServiceMappings(config.getClientServiceMappings());
}
if (config.getServerServiceMappings() != null) {
zipkin.setServerServiceMappings(config.getServerServiceMappings());
}
zipkin.setIncludeMessageBody(config.isIncludeMessageBody());
zipkin.setIncludeMessageBodyStreams(config.isIncludeMessageBodyStreams());
// register the bean into CamelContext
zipkin.init(camelContext);
return zipkin;
}
Aggregations