Skip to content

Consider including MessageId tag in RabbitMQActivitySource during BasicPublish #1849

Open
@YayBurritos

Description

@YayBurritos

Is your feature request related to a problem? Please describe.

The Deliver method of RabbitMQActivitySource accepts IReadOnlyBasicProperties as input. This allows the MessageId, if provided, to be added as a tag (span attribute) in the PopulateMessagingTags method:

            if (!string.IsNullOrEmpty(readOnlyBasicProperties.MessageId))
            {
                activity.SetTag(MessageId, readOnlyBasicProperties.MessageId);
            }

However, the BasicPublish method currently doesn't accept IReadOnlyBasicProperties as input, so MessageId can't be included.

Having MessageId as a tag in both the "publish" and "deliver" trace spans will allow users to be able to find traces - both from the publisher and consumer perspective - if they know the MessageId, which could theoretically be obtained from application logs, an audit table, etc.

Describe the solution you'd like

I'd like to update the RabbitMQActivitySource.BasicPublish method to allow for IReadOnlyBasicProperties to be passed in as an additional parameter. That would allow the IReadOnlyBasicProperties to then be passed along to the PopulateMessagingTags method, which would add the MessageId as a tag.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions