Class Tracer

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.RoutePolicyFactory, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

    public abstract class Tracer
    extends org.apache.camel.support.service.ServiceSupport
    implements org.apache.camel.spi.RoutePolicyFactory, org.apache.camel.StaticService, org.apache.camel.CamelContextAware
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static Map<String,​SpanDecorator> DECORATORS  
      protected boolean encoding  
      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Constructor Summary

      Constructors 
      Constructor Description
      Tracer()  
    • Field Detail

      • encoding

        protected boolean encoding
    • Constructor Detail

      • Tracer

        public Tracer()
    • Method Detail

      • initTracer

        protected abstract void initTracer()
      • finishSpan

        protected abstract void finishSpan​(SpanAdapter span)
      • getTracingStrategy

        public org.apache.camel.spi.InterceptStrategy getTracingStrategy()
        Returns the currently used tracing strategy which is responsible for tracking invoked EIP or beans.
        Returns:
        The currently used tracing strategy
      • setTracingStrategy

        public void setTracingStrategy​(org.apache.camel.spi.InterceptStrategy tracingStrategy)
        Specifies the instance responsible for tracking invoked EIP and beans with Tracing.
        Parameters:
        tracingStrategy - The instance which tracks invoked EIP and beans
      • addDecorator

        public void addDecorator​(SpanDecorator decorator)
      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • setCamelContext

        public void setCamelContext​(org.apache.camel.CamelContext camelContext)
        Specified by:
        setCamelContext in interface org.apache.camel.CamelContextAware
      • getExcludePatterns

        public Set<String> getExcludePatterns()
      • setExcludePatterns

        public void setExcludePatterns​(Set<String> excludePatterns)
      • isEncoding

        public boolean isEncoding()
      • setEncoding

        public void setEncoding​(boolean encoding)
      • addExcludePattern

        public void addExcludePattern​(String pattern)
        Adds an exclude pattern that will disable tracing for Camel messages that matches the pattern.
        Parameters:
        pattern - the pattern such as route id, endpoint url
      • createRoutePolicy

        public org.apache.camel.spi.RoutePolicy createRoutePolicy​(org.apache.camel.CamelContext camelContext,
                                                                  String routeId,
                                                                  org.apache.camel.NamedNode route)
        Specified by:
        createRoutePolicy in interface org.apache.camel.spi.RoutePolicyFactory
      • init

        public void init​(org.apache.camel.CamelContext camelContext)
        Registers this Tracer on the CamelContext if not already registered.
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • doShutdown

        protected void doShutdown()
                           throws Exception
        Overrides:
        doShutdown in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • getSpanDecorator

        protected SpanDecorator getSpanDecorator​(org.apache.camel.Endpoint endpoint)