-
Notifications
You must be signed in to change notification settings - Fork 613
Closed
Description
Describe the bug
Following code does not generate activity for RabbitMQ.Client.Subscriber activity source.
var consumer = new EventingBasicConsumer(channel);
consumer.Received += (model, ea) =>
{
var receivedBody = ea.Body.ToArray();
var receivedMessage = Encoding.UTF8.GetString(receivedBody);
Console.WriteLine($"Received: {receivedMessage}");
};
channel.BasicConsumeAsync(queue: "hello", autoAck: true, consumer);
Reproduction steps
- Have an application consuming messages from queue: https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/3373/files#diff-b8bf5e4638613373d455983b52f680cbac4c13732b860567bda571a9e0b29638R40-R44
- Have properly defined listener for
RabbitMQ.Client.Subscriber - If you are using
channel.BasicConsumeAsyncon .NET Framework 4.6.2, Activity is not generated forchannel.BasicConsumeAsync.
It is working fine for .NET6, .NET7 and .NET8. channel.BasicGetAsync generated proper activities.
Expected behavior
Activity RabbitMQ.Client.Subscriber is generated also for channel.BasicConsumeAsync method on .NET Framework.
Additional context
Found while working on introducing RabbitMQ.Client in OpenTelemetry .NET Automatic Instrumentation.
PR: open-telemetry/opentelemetry-dotnet-instrumentation#3373