fix(instrumentation-pika): update span attributes to current messaging semconv#4654
Open
stark256-spec wants to merge 1 commit into
Open
fix(instrumentation-pika): update span attributes to current messaging semconv#4654stark256-spec wants to merge 1 commit into
stark256-spec wants to merge 1 commit into
Conversation
…g semconv Replaces deprecated attribute constants from opentelemetry.semconv.trace and net_attributes with the current incubating messaging_attributes equivalents, and net peer attributes with server_attributes: - messaging.system (SpanAttributes → MESSAGING_SYSTEM) - messaging.operation → messaging.operation.type (MESSAGING_OPERATION_TYPE) - messaging.temp_destination → messaging.destination.temporary - messaging.destination → messaging.destination.name - messaging.message_id → messaging.message.id - messaging.conversation_id → messaging.message.conversation_id - net.peer.name → server.address - net.peer.port → server.port Also adds two RabbitMQ-specific attributes now present in the spec: - messaging.rabbitmq.destination.routing_key (threaded through from method) - messaging.rabbitmq.message.delivery_tag (threaded through from method) MessagingOperationValues.RECEIVE replaced with MessagingOperationTypeValues.RECEIVE throughout. All 19 unit tests updated and passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Updates the pika instrumentation to use the current OpenTelemetry messaging semantic conventions, replacing deprecated constants throughout
utils.py.Fixes #1643
Attribute mapping
SpanAttributes.MESSAGING_SYSTEMMESSAGING_SYSTEM(messaging_attributes)SpanAttributes.MESSAGING_OPERATION(messaging.operation)MESSAGING_OPERATION_TYPE(messaging.operation.type)SpanAttributes.MESSAGING_TEMP_DESTINATIONMESSAGING_DESTINATION_TEMPORARYSpanAttributes.MESSAGING_DESTINATIONMESSAGING_DESTINATION_NAMESpanAttributes.MESSAGING_MESSAGE_IDMESSAGING_MESSAGE_IDSpanAttributes.MESSAGING_CONVERSATION_IDMESSAGING_MESSAGE_CONVERSATION_IDNET_PEER_NAME(net.peer.name)SERVER_ADDRESS(server.address)NET_PEER_PORT(net.peer.port)SERVER_PORT(server.port)MessagingOperationValues.RECEIVEMessagingOperationTypeValues.RECEIVEAlso adds two RabbitMQ-specific attributes that were missing:
messaging.rabbitmq.destination.routing_key— set on both producer and consumer spans when a routing key is presentmessaging.rabbitmq.message.delivery_tag— set on consumer spans frommethod.delivery_tagType of change
How Has This Been Tested?
tests/test_utils.pyupdated to assert the new attribute names and values; all pass.test_enrich_span_with_routing_keyandtest_enrich_span_with_delivery_tag.Does This PR Require a Core Repo Change?
Checklist: