io.opentracing.contrib:opentracing-spring-rabbitmq-parent

OpenTracing instrumentation for RabbitMQ

License

License

GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-spring-rabbitmq-parent
Last Version

Last Version

3.0.1
Release Date

Release Date

Type

Type

pom
Description

Description

io.opentracing.contrib:opentracing-spring-rabbitmq-parent
OpenTracing instrumentation for RabbitMQ
Project URL

Project URL

https://github.com/opentracing-contrib/java-spring-rabbitmq
Source Code Management

Source Code Management

https://github.com/opentracing-contrib/java-spring-rabbitmq

Download opentracing-spring-rabbitmq-parent

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-rabbitmq-parent/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-spring-rabbitmq-parent</artifactId>
    <version>3.0.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-rabbitmq-parent/
implementation 'io.opentracing.contrib:opentracing-spring-rabbitmq-parent:3.0.1'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-spring-rabbitmq-parent/
implementation ("io.opentracing.contrib:opentracing-spring-rabbitmq-parent:3.0.1")
'io.opentracing.contrib:opentracing-spring-rabbitmq-parent:pom:3.0.1'
<dependency org="io.opentracing.contrib" name="opentracing-spring-rabbitmq-parent" rev="3.0.1">
  <artifact name="opentracing-spring-rabbitmq-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-spring-rabbitmq-parent', version='3.0.1')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-spring-rabbitmq-parent" % "3.0.1"
[io.opentracing.contrib/opentracing-spring-rabbitmq-parent "3.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • opentracing-spring-rabbitmq
  • opentracing-spring-rabbitmq-starter
  • opentracing-spring-rabbitmq-it

Build Status Released Version

OpenTracing Spring RabbitMQ

Provides message tracing for RabbitMQ through Spring AMQP. It can be used with any OpenTracing compatible implementation.

Compatibility table

Version OpenTracing API Spring Boot version
0.x.x 0.31.0 1.5.x
1.x.x 0.31.0 2.1.x
1.0.2 0.32.0 2.1.x
2.0.x 0.32.0 2.1.x
3.0.x 0.33.0 2.1.x

Sent messages

The following methods are instrumented:

Class Method Instrumented
AmqpTemplate void send(Message message)
AmqpTemplate void send(String routingKey, Message message)
AmqpTemplate void send(String exchange, String routingKey, Message message)
AmqpTemplate void convertAndSend(Object message)
AmqpTemplate void convertAndSend(String routingKey, Object message)
AmqpTemplate void convertAndSend(String exchange, String routingKey, Object message)
AmqpTemplate void convertAndSend(Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate void convertAndSend(String routingKey, Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate void convertAndSend(String exchange, String routingKey, Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate void convertAndSend(String exchange, String routingKey, Object message, @Nullable CorrelationData correlationData)
AmqpTemplate Message sendAndReceive(Message message)
AmqpTemplate Message sendAndReceive(String routingKey, Message message)
AmqpTemplate Message sendAndReceive(String exchange, String routingKey, Message message)
AmqpTemplate Object convertSendAndReceive(Object message)
AmqpTemplate Object convertSendAndReceive(String routingKey, Object message)
AmqpTemplate Object convertSendAndReceive(String exchange, String routingKey, Object message)
AmqpTemplate Object convertSendAndReceive(Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate Object convertSendAndReceive(String routingKey, Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate Object convertSendAndReceive(String exchange, String routingKey, Object message, MessagePostProcessor messagePostProcessor)
AmqpTemplate <T> T convertSendAndReceiveAsType(Object message, ParameterizedTypeReference<T> responseType)
AmqpTemplate <T> T convertSendAndReceiveAsType(String routingKey, Object message,ParameterizedTypeReference<T> responseType)
AmqpTemplate <T> T convertSendAndReceiveAsType(String routingKey, Object message, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<T> responseType)
AmqpTemplate <T> T convertSendAndReceiveAsType(String exchange, String routingKey, Object message,MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<T> responseType)
RabbitTemplate Message sendAndReceive(final String exchange, final String routingKey, final Message message, @Nullable CorrelationData correlationData)
RabbitTemplate Object convertSendAndReceive(final String exchange, final String routingKey, final Object message, @Nullable CorrelationData correlationData)

Received messages

At startup a RabbitMqReceiveTracingInterceptor, will be added toSimpleMessageListenerContainer or DirectMessageListenerContaineradvice chain, depending on your configuration.

@RabbitListener will also benefit from it.

Span decorator

By default, a RabbitMqSpanDecorator is provided, with the following attributes:

On send span

  • component: rabbitmq
  • exchange: [exchange_name]
  • messageid: [message_id]
  • routingkey: [routing_key]

On receive span

  • component: rabbitmq
  • exchange: [exchange_name]
  • messageid: [message_id]
  • routingkey: [routing_key]
  • consumerqueue: [consumer_queue]

On send reply

Nothing by default.

On error

  • event: error key
  • error.object: exception

Note: you can customize your spans by declaring an overridden RabbitMqSpanDecorator bean.

Usage

This library is embedded in java-spring-cloud

Usage with Jaeger tracer

If you want to use Jaeger as tracer, you can benefit directly from it by importing java-spring-jaeger.

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
</dependency>

Usage with Zipkin tracer

If you want to use Zipkin as tracer, you can benefit directly from it by importing java-spring-zipkin.

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-zipkin-cloud-starter</artifactId>
</dependency>

Standalone usage

Note: make sure that an io.opentracing.Tracer bean is available. It is not provided by this library.

With Spring Boot

Add the following starter dependency to your pom.xml:

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-rabbitmq-starter</artifactId>
</dependency>

With Spring

Add the following dependency to your pom.xml:

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-rabbitmq</artifactId>
</dependency>

Jaeger UI example

Alt text

Development

Maven checkstyle plugin is used to maintain consistent code style based on Google Style Guides

./mvnw clean install

Release

Follow instructions in RELEASE

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
3.0.1
3.0.0
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.0.2
1.0.1
1.0.0
0.1.2
0.1.1
0.1.0