Class AbstractSpanDecorator
- java.lang.Object
-
- org.apache.camel.tracing.decorators.AbstractSpanDecorator
-
- All Implemented Interfaces:
SpanDecorator
- Direct Known Subclasses:
AbstractHttpSpanDecorator
,AbstractInternalSpanDecorator
,AbstractMessagingSpanDecorator
,CqlSpanDecorator
,ElasticsearchSpanDecorator
,JdbcSpanDecorator
,LogSpanDecorator
,MongoDBSpanDecorator
,SqlSpanDecorator
,TimerSpanDecorator
public abstract class AbstractSpanDecorator extends Object implements SpanDecorator
An abstract base implementation of theSpanDecorator
interface.
-
-
Field Summary
-
Fields inherited from interface org.apache.camel.tracing.SpanDecorator
CAMEL_COMPONENT, DEFAULT
-
-
Constructor Summary
Constructors Constructor Description AbstractSpanDecorator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtractAdapter
getExtractAdapter(Map<String,Object> map, boolean encoding)
This method returns the map to be used for headers extraction when the component is receiving a communication.SpanKind
getInitiatorSpanKind()
This method returns the 'span.kind' value for use when the component is initiating a communication.InjectAdapter
getInjectAdapter(Map<String,Object> map, boolean encoding)
This method returns the map to be used for headers injection when the component is receiving a communication.String
getOperationName(org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
This method returns the operation name to use with the Span representing this exchange and endpoint.SpanKind
getReceiverSpanKind()
This method returns the 'span.kind' value for use when the component is receiving a communication.boolean
newSpan()
This method indicates whether the component associated with the SpanDecorator should result in a new span being created.void
post(SpanAdapter span, org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
This method adds appropriate details (tags/logs) to the supplied span based on the post processing of the exchange.void
pre(SpanAdapter span, org.apache.camel.Exchange exchange, org.apache.camel.Endpoint endpoint)
This method adds appropriate details (tags/logs) to the supplied span based on the pre processing of the exchange.static String
stripSchemeAndOptions(org.apache.camel.Endpoint endpoint)
This method removes the scheme, any leading slash characters and options from the supplied URI.static Map<String,String>
toQueryParameters(String uri)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.tracing.SpanDecorator
getComponent, getComponentClassName
-
-
-
-
Method Detail
-
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
-
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 interfaceSpanDecorator
- 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 interfaceSpanDecorator
- Parameters:
exchange
- The exchangeendpoint
- 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 interfaceSpanDecorator
- Parameters:
span
- The spanexchange
- The exchangeendpoint
- 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 interfaceSpanDecorator
- Parameters:
span
- The spanexchange
- The exchangeendpoint
- 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 interfaceSpanDecorator
- 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 interfaceSpanDecorator
- 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 headers extraction when the component is receiving a communication.- Specified by:
getExtractAdapter
in interfaceSpanDecorator
- Parameters:
map
- a map containing the objectsencoding
- 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 headers injection when the component is receiving a communication.- Specified by:
getInjectAdapter
in interfaceSpanDecorator
- Parameters:
map
- a map containing the objectsencoding
- whether the headers are encoded- Returns:
- The injection map
-
-