@ManagedResource(description="OpenTracingTracer")
public class OpenTracingTracer
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.RoutePolicyFactory, org.apache.camel.StaticService, org.apache.camel.CamelContextAware
OpenTracingTracer
in your Camel application.
This class is implemented as both an EventNotifier
and RoutePolicy
that allows
to trap when Camel starts/ends an Exchange
being routed using the RoutePolicy
and during the routing
if the Exchange
sends messages, then we track them using the EventNotifier
.Constructor and Description |
---|
OpenTracingTracer() |
Modifier and Type | Method and Description |
---|---|
void |
addExcludePattern(String pattern)
Adds an exclude pattern that will disable tracing for Camel messages that matches the pattern.
|
org.apache.camel.spi.RoutePolicy |
createRoutePolicy(org.apache.camel.CamelContext camelContext,
String routeId,
org.apache.camel.model.RouteDefinition route) |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
Set<String> |
getExcludePatterns() |
protected SpanDecorator |
getSpanDecorator(org.apache.camel.Endpoint endpoint) |
io.opentracing.Tracer |
getTracer() |
void |
init(org.apache.camel.CamelContext camelContext)
Registers this
OpenTracingTracer on the CamelContext if not already registered. |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setExcludePatterns(Set<String> excludePatterns) |
void |
setTracer(io.opentracing.Tracer tracer) |
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public org.apache.camel.spi.RoutePolicy createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.model.RouteDefinition route)
createRoutePolicy
in interface org.apache.camel.spi.RoutePolicyFactory
public void init(org.apache.camel.CamelContext camelContext)
OpenTracingTracer
on the CamelContext
if not already registered.public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public void addExcludePattern(String pattern)
pattern
- the pattern such as route id, endpoint urlpublic io.opentracing.Tracer getTracer()
public void setTracer(io.opentracing.Tracer tracer)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ServiceSupport
Exception
protected SpanDecorator getSpanDecorator(org.apache.camel.Endpoint endpoint)
Apache Camel