Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure aio-pika instrumentation follows semantic conventions #1638

Open
Tracked by #1637
srikanthccv opened this issue Feb 4, 2023 · 2 comments · May be fixed by P6rguVyrst/opentelemetry-python-contrib#1 or #2705
Open
Tracked by #1637
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed instrumentation

Comments

@srikanthccv
Copy link
Member

No description provided.

@P6rguVyrst
Copy link

Would like to pick this up as part of: open-telemetry/opentelemetry-python#4045

cc @xrmx

@P6rguVyrst
Copy link

In current version the required attributes for messaging-spans are:

Attribute Type Description Examples Requirement Level
messaging.operation.type string A string identifying the type of the messaging operation. [1] publish; create; receive Required
messaging.system string The messaging system as identified by the client instrumentation. [2] activemq; aws_sqs; eventgrid Required
error.type string Describes a class of error the operation ended with. [3] amqp:decode-error; KAFKA_STORAGE_ERROR; channel-error Conditionally Required If and only if the messaging operation has failed.
messaging.batch.message_count int The number of messages sent, received, or processed in the scope of the batching operation. [4] 0; 1; 2 Conditionally Required [5]
messaging.destination.anonymous boolean A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). Conditionally Required [6]
messaging.destination.name string The message destination name [7] MyQueue; MyTopic Conditionally Required [8]
messaging.destination.template string Low cardinality representation of the messaging destination name [9] /customers/{customerId} Conditionally Required [10]
messaging.destination.temporary boolean A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. Conditionally Required [11]
server.address string Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [12] example.com; 10.1.2.80; /tmp/my.sock Conditionally Required If available.

opentelemetry-instrumentation-aio-pika, is currently on the semconv version of 1.11.0, and we're looking to get to 1.26.0 (subject to change).

We use the following semantic convention classes to instrument the aio-pika library:

 from opentelemetry.semconv.trace import (                                                                                                     
     MessagingOperationValues,                                                                                                                 
     SpanAttributes,                                                                                                                           
 )

Within those we use the following 8 SpanAttributes:

SpanAttributes.MESSAGING_SYSTEM: "rabbitmq"
self._attributes[SpanAttributes.MESSAGING_DESTINATION] = destination
SpanAttributes.NET_PEER_NAME: url.host,
SpanAttributes.NET_PEER_PORT: url.port or 5672,
SpanAttributes.MESSAGING_MESSAGE_ID
SpanAttributes.MESSAGING_CONVERSATION_ID
self._attributes[SpanAttributes.MESSAGING_OPERATION] = self._operation.value
self._attributes[SpanAttributes.MESSAGING_TEMP_DESTINATION] = True

However, that location doesn't include the current semantic conventions, as they've been moved to semconv/_incubating/attributes

To follow the latest semantic conventions, we will need to reference the incubating values referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment