Conversation
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/MassTransit7Tests.cs
Show resolved
Hide resolved
BenchmarksBenchmark execution time: 2026-03-24 20:21:08 Comparing candidate commit cb18df6 in PR branch Found 3 performance improvements and 10 performance regressions! Performance is the same for 258 metrics, 17 unstable metrics.
|
Optimize LINQ iterations on Activity.Tags: - Replace multiple FirstOrDefault() calls with single foreach loop - Use switch statement for better performance - Add early exit when all required tags are found - Reduces overhead in GetActivityKind and EnhanceActivityMetadata methods 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary of changes
Adds automatic instrumentation for MassTransit 7.x and 8.x, a popular distributed application framework for .NET. The integration captures distributed traces across message
producers and consumers, propagates trace context across transport boundaries (RabbitMQ, Amazon SQS, In-Memory), and supports both DiagnosticSource (MT7) and
OpenTelemetry Activity (MT8) instrumentation patterns.
Reason for change
MassTransit is a widely-used message bus framework in the .NET ecosystem. This integration provides customers with end-to-end visibility into distributed message-driven
architectures, allowing them to track message flow across services, identify performance bottlenecks, and correlate traces across synchronous HTTP and asynchronous messaging
operations.
Implementation details
MassTransit 7.x:
DiagnosticSourcelisteners (MassTransit.ReceivePipe,MassTransit.ConsumeContext)ConsumeContext,SendContext, andPublishContextfor context propagationRECEIVEandPROCESSspans for incoming messages,SENDspans for outgoing messagesMassTransit 8.x:
ActivitySourceinstrumentationx-datadog-*,_datadog)Key technical decisions:
foreachwithswitchvs multiple LINQ calls)Test coverage
MassTransit7Tests.cs- DiagnosticSource instrumentation across multiple transportsMassTransit8Tests.cs- OpenTelemetry Activity enhancement across multiple transportsOther details
Compatibility:
NEED TO TEST WITH Azure Service Bus !!!