Class TracingUtils
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.tracing.TracingUtils
-
public abstract class TracingUtils extends Object
Utility methods to manage spans for incoming and outgoing messages.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Message<T>addIncomingTrace(IncomingRabbitMQMessage<T> msg, String queue, List<String> attributeHeaders)Creates a span based on any tracing metadata in the incoming message.static voidcreateOutgoingTrace(Message<?> message, Map<String,Object> headers, String exchange, String routingKey, List<String> attributeHeaders)Creates a new outgoing message span message, and ensures span metadata is added to the message headers.static TracingMetadatagetTracingMetaData(io.vertx.rabbitmq.RabbitMQMessage msg)Extract tracing metadata from a received RabbitMQ message and return it asTracingMetadata.static voidinitialise()
-
-
-
Method Detail
-
initialise
public static void initialise()
-
getTracingMetaData
public static TracingMetadata getTracingMetaData(io.vertx.rabbitmq.RabbitMQMessage msg)
Extract tracing metadata from a received RabbitMQ message and return it asTracingMetadata.- Parameters:
msg- the incoming RabbitMQ message- Returns:
- a
TracingMetadatainstance, possibly empty but never null
-
addIncomingTrace
public static <T> Message<T> addIncomingTrace(IncomingRabbitMQMessage<T> msg, String queue, List<String> attributeHeaders)
Creates a span based on any tracing metadata in the incoming message.- Type Parameters:
T- the message body type- Parameters:
msg- the incoming messageattributeHeaders- a list (possibly empty) of header names whose values (if present) should be used as span attributes- Returns:
- the message, with injected tracing metadata
-
createOutgoingTrace
public static void createOutgoingTrace(Message<?> message, Map<String,Object> headers, String exchange, String routingKey, List<String> attributeHeaders)
Creates a new outgoing message span message, and ensures span metadata is added to the message headers.- Parameters:
message- the source messageheaders- the outgoing headers, must be mutableexchange- the target exchangeroutingKey- the routing keyattributeHeaders- a list (possibly empty) of header names whose values (if present) should be used as span attributes
-
-