Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 809 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 809 Bytes

Rebus.OpenTelemetry

Makes Rebus emit Diagnostic traces, which OpenTelemetry can be used to generate tracing.

Usage

Add the packages:

Rebus.Diagnostics
Rebus.OpenTelemetry

When configuring Rebus call EnableDiagnosticSources like this:

using var publisherActivator = new BuiltinHandlerActivator();

var bus = Configure.With(publisherActivator)
    .Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "Messages"))
    .Options(o => o.EnableDiagnosticSources()) // This is the important line
    .Start();

Then add Rebus tracing to your OpenTelemetry calls, by doing AddRebusInstrumentation:

var tracerProvider = Sdk.CreateTracerProviderBuilder()
                .AddRebusInstrumentation()
                .Build()

And then everything should just work. 🙂