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
An abstract base implementation of the
SpanDecorator interface.-
Field Summary
Fields inherited from interface org.apache.camel.tracing.SpanDecorator
CAMEL_COMPONENT, DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExtractAdapter(Map<String, Object> map, boolean encoding) This method returns the map to be used for header extraction when the component is receiving a communication.This method returns the 'span.kind' value for use when the component is initiating a communication.getInjectAdapter(Map<String, Object> map, boolean encoding) This method returns the map to be used for header injection when the component is receiving a communication.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.This method returns the 'span.kind' value for use when the component is receiving a communication.booleannewSpan()This method indicates whether the component associated with the SpanDecorator should result in a new span being created.voidpost(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.voidpre(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 StringstripSchemeAndOptions(String endpointUri) static StringstripSchemeAndOptions(org.apache.camel.Endpoint endpoint) This method removes the scheme, any leading slash characters and options from the supplied URI.toQueryParameters(String uri) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.tracing.SpanDecorator
getComponent, getComponentClassName
-
Constructor Details
-
AbstractSpanDecorator
public AbstractSpanDecorator()
-
-
Method Details
-
stripSchemeAndOptions
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
-
toQueryParameters
-
newSpan
public boolean newSpan()Description copied from interface:SpanDecoratorThis method indicates whether the component associated with the SpanDecorator should result in a new span being created.- Specified by:
newSpanin 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:SpanDecoratorThis method returns the operation name to use with the Span representing this exchange and endpoint.- Specified by:
getOperationNamein 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:SpanDecoratorThis method adds appropriate details (tags/logs) to the supplied span based on the pre-processing of the exchange.- Specified by:
prein 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:SpanDecoratorThis method adds appropriate details (tags/logs) to the supplied span based on the post-processing of the exchange.- Specified by:
postin interfaceSpanDecorator- Parameters:
span- The spanexchange- The exchangeendpoint- The endpoint
-
getInitiatorSpanKind
Description copied from interface:SpanDecoratorThis method returns the 'span.kind' value for use when the component is initiating a communication.- Specified by:
getInitiatorSpanKindin interfaceSpanDecorator- Returns:
- The kind
-
getReceiverSpanKind
Description copied from interface:SpanDecoratorThis method returns the 'span.kind' value for use when the component is receiving a communication.- Specified by:
getReceiverSpanKindin interfaceSpanDecorator- Returns:
- The kind
-
getExtractAdapter
Description copied from interface:SpanDecoratorThis method returns the map to be used for header extraction when the component is receiving a communication.- Specified by:
getExtractAdapterin interfaceSpanDecorator- Parameters:
map- a map containing the objectsencoding- whether the headers are encoded- Returns:
- The extraction map
-
getInjectAdapter
Description copied from interface:SpanDecoratorThis method returns the map to be used for header injection when the component is receiving a communication.- Specified by:
getInjectAdapterin interfaceSpanDecorator- Parameters:
map- a map containing the objectsencoding- whether the headers are encoded- Returns:
- The injection map
-