Class AbstractSpanDecorator

java.lang.Object
org.apache.camel.tracing.decorators.AbstractSpanDecorator
All Implemented Interfaces:
SpanDecorator
Direct Known Subclasses:
AbstractHttpSpanDecorator, AbstractInternalSpanDecorator, AbstractMessagingSpanDecorator, AzureStorageDataLakeSpanDecorator, CqlSpanDecorator, ElasticsearchSpanDecorator, FileSpanDecorator, JdbcSpanDecorator, LogSpanDecorator, MongoDBSpanDecorator, SqlSpanDecorator, TimerSpanDecorator

public abstract class AbstractSpanDecorator extends Object implements SpanDecorator
An abstract base implementation of the SpanDecorator interface.
  • Constructor Details

    • AbstractSpanDecorator

      public AbstractSpanDecorator()
  • Method Details

    • stripSchemeAndOptions

      public static String stripSchemeAndOptions(org.apache.camel.Endpoint endpoint)
      This method removes the scheme, any leading slash characters and options from the supplied URI. This is intended to extract a meaningful name from the URI that can be used in situations, such as the operation name.
      Parameters:
      endpoint - The endpoint
      Returns:
      The stripped value from the URI
    • stripSchemeAndOptions

      public static String stripSchemeAndOptions(String endpointUri)
    • toQueryParameters

      public static Map<String,String> toQueryParameters(String uri)
    • newSpan

      public boolean newSpan()
      Description copied from interface: SpanDecorator
      This method indicates whether the component associated with the SpanDecorator should result in a new span being created.
      Specified by:
      newSpan in interface SpanDecorator
      Returns:
      Whether a new span should be created
    • getOperationName

      public String getOperationName(org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
      Description copied from interface: SpanDecorator
      This method returns the operation name to use with the Span representing this exchange and endpoint.
      Specified by:
      getOperationName in interface SpanDecorator
      Parameters:
      exchange - The exchange
      endpoint - The endpoint
      Returns:
      The operation name
    • pre

      public void pre(SpanAdapter span, org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
      Description copied from interface: SpanDecorator
      This method adds appropriate details (tags/logs) to the supplied span based on the pre-processing of the exchange.
      Specified by:
      pre in interface SpanDecorator
      Parameters:
      span - The span
      exchange - The exchange
      endpoint - The endpoint
    • post

      public void post(SpanAdapter span, org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
      Description copied from interface: SpanDecorator
      This method adds appropriate details (tags/logs) to the supplied span based on the post-processing of the exchange.
      Specified by:
      post in interface SpanDecorator
      Parameters:
      span - The span
      exchange - The exchange
      endpoint - The endpoint
    • getInitiatorSpanKind

      public SpanKind getInitiatorSpanKind()
      Description copied from interface: SpanDecorator
      This method returns the 'span.kind' value for use when the component is initiating a communication.
      Specified by:
      getInitiatorSpanKind in interface SpanDecorator
      Returns:
      The kind
    • getReceiverSpanKind

      public SpanKind getReceiverSpanKind()
      Description copied from interface: SpanDecorator
      This method returns the 'span.kind' value for use when the component is receiving a communication.
      Specified by:
      getReceiverSpanKind in interface SpanDecorator
      Returns:
      The kind
    • getExtractAdapter

      public ExtractAdapter getExtractAdapter(Map<String,Object> map, boolean encoding)
      Description copied from interface: SpanDecorator
      This method returns the map to be used for header extraction when the component is receiving a communication.
      Specified by:
      getExtractAdapter in interface SpanDecorator
      Parameters:
      map - a map containing the objects
      encoding - whether the headers are encoded
      Returns:
      The extraction map
    • getInjectAdapter

      public InjectAdapter getInjectAdapter(Map<String,Object> map, boolean encoding)
      Description copied from interface: SpanDecorator
      This method returns the map to be used for header injection when the component is receiving a communication.
      Specified by:
      getInjectAdapter in interface SpanDecorator
      Parameters:
      map - a map containing the objects
      encoding - whether the headers are encoded
      Returns:
      The injection map