Closed lmolkova closed 2 months ago
Looking at existing usage of this attribute, it seems we've created some confusion with it:
Both attributes are set, but somehow they are different for queues and topics?
span.set_attribute("messaging.destination.name", queue_url.rsplit("/")[-1])
span.set_attribute("messaging.destination_publish.name", topic or queue_url.rsplit("/")[-1])
Different attributes are set depending on the kind https://github.com/airtai/faststream/blob/28f47833dd77509f4596fb582e6b539468c31fbc/tests/opentelemetry/basic.py#L102-L113
if span.kind == SpanKind.PRODUCER and action in (Action.CREATE, Action.PUBLISH):
assert attrs[SpanAttr.MESSAGING_DESTINATION_NAME] == queue, attrs[
SpanAttr.MESSAGING_DESTINATION_NAME
]
if span.kind == SpanKind.CONSUMER and action in (Action.CREATE, Action.PROCESS):
assert attrs[MESSAGING_DESTINATION_PUBLISH_NAME] == queue, attrs[
MESSAGING_DESTINATION_PUBLISH_NAME
]
assert attrs[SpanAttr.MESSAGING_MESSAGE_ID] == IsUUID, attrs[
SpanAttr.MESSAGING_MESSAGE_ID
]
Destination_publish is set on producer for rabbitmq (to exchange) https://github.com/open-telemetry/opentelemetry-php-contrib/blob/9f96b59bc483cc495edc49cef0d63b637a46fffa/src/Instrumentation/ExtAmqp/src/ExtAmqpInstrumentation.php#L61
->setAttribute(TraceAttributes::MESSAGING_DESTINATION_NAME, $routingKey)
->setAttribute(TraceAttributes::MESSAGING_DESTINATION_PUBLISH_NAME, sprintf('%s%s', $exchange->getName() != '' ? $exchange->getName() . ' ': '', $routingKey))
Given all of this, I'd like to exclude
messaging.destination_publish.*
from the stabilization scope or even deprecate it as something we don't know where/how to use.
I second that.
One thing we should ensure for stabilization: that those attributes (or similar) attributes are not needed on metrics. They're not in the current list of attributes on metrics, however, I'd like us to validate that again. If there's no need for those attributes on metrics, let's exclude them from initial stability.
Discussed on messaging SIG 7/11:
Let's deprecate messaging.destination_publish.*
attributes since we have no real-life use-case for them and current usages are not correct.
messaging.destination.original.name
could be an alternative name.Given all of this, I'd like to exclude
messaging.destination_publish.*
from the stabilization scope or even deprecate it as something we don't know where/how to use.