Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public Task StartAsync(CancellationToken cancellationToken)
async Task ReceivedHandler(object model, BasicDeliverEventArgs args)
{
using Activity activity = RabbitMQActivitySource.StartActivity(args.BasicProperties);
activity?.AddTag("amqp.queue", this.queue);
activity?.AddTag("amqp.channel", this.channel);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.channel is not a string so it cannot be used here. maybe we can have args.DeliveryTag instead.

activity?.AddTag("amqp.bodySize", args.Body.Length);

var input = new TriggeredFunctionData() { TriggerValue = args };

Expand All @@ -118,6 +121,7 @@ async Task ReceivedHandler(object model, BasicDeliverEventArgs args)
args.BasicProperties.Headers ??= new Dictionary<string, object>();
args.BasicProperties.Headers.TryGetValue(RequeueCountHeaderName, out object headerValue);
int requeueCount = Convert.ToInt32(headerValue, CultureInfo.InvariantCulture) + 1;
activity?.AddTag("amqp.requeueCount", requeueCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds vague since this would show requeueCount=1 even when the is message not requeued. i suggest modifying to

activity?.AddTag("amqp.currentRequeueCount", requeueCount-1);


if (requeueCount >= 5)
{
Expand Down