Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds new span attributes containing endpoint information from a message broker. This is so the Java Agent can properly link with infrastructure entities generated from AWS MQ. In addition, otel compatible attributes are also added (some are experimental) for routing keys and queues for RabbitMQ.
The new span attributes are the following:
server.address
which contain the message broker hostserver.port
which contain the message broker port.messaging.rabbitmq.destination.routing_key
which is the routing key for a RabbitMQ operationmessaging.destination.name
which will be the destination for a RabbitMQ operation. For producers this will be the exchange name. For consumers this is the queue name.messaging.destination_publish.name
is an otel attribute for message consumers used to indicate what the destination name for the producer is. In the case of RabbitMQ, this is the exchange name.The externals API has new optional parameters to add host and port for message broker spans, via the method
instance(host,port)
.For example
Our JMS (if ActiveMQ is used) and RabbitMQ instrumentation automatically add the span attributes.
To get host and port from ActiveMQ, a new instrumentation module was added called
activemq-client-5.8.0
On top of that, the
rabbit-amqp
andjms
instrumentation was altered to automatically include host and port span attributes.For our RabbitMQ instrumentation, the existing agent attributes
message.routingKey
andmessage.queueName
are also added to spans.In addition the instrumentation was revised so instrumentation module names better match the versions they apply to and to allow host and port information to be reported.
Related Github Issue
#1876
#1832