Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

jbogard/NServiceBus.Extensions.Diagnostics.OpenTelemetry

Repository files navigation

This repo is no longer maintained. All of its functionality is now present in NServiceBus OTel support.

NServiceBus.Extensions.Diagnostics

CI NuGet NuGet MyGet (dev)

Tracing Usage

The NServiceBus.Extensions.Diagnostics.OpenTelemetry package provides an extension to OpenTelemetry.

It is a small wrapper to subscribe to the ActivitySource exposed as part of NServiceBus.Extensions.Diagnostics, and is not required to use as part of OpenTelemetry.

You can configure OpenTelemetry (typically through the OpenTelemetry.Extensions.Hosting package).

services.AddOpenTelemetryTracing(builder => {
    builder
        // Configure exporters
        .AddZipkinExporter()
        // Configure adapters
        .AddAspNetCoreInstrumentation()
        .AddHttpClientInstrumentation()
        .AddNServiceBusInstrumentation(); // Adds NServiceBus OTel support
});

This extension method only adds a source with the appropriate name:

public static TracerProviderBuilder AddNServiceBusInstrumentation(this TracerProviderBuilder builder)
{
    return builder.AddSource("NServiceBus.Extensions.Diagnostics");
}

Since OTel is supported at the NServiceBus level, any transport that NServiceBus supports also supports OTel.

This package supports OpenTelemetry version 1.2.0-rc1 and above.

Metrics Usage

This package also includes a small extension method to add the NServiceBus.Extensions.Diagnostics Meter, for OTel metrics:

services.AddOpenTelemetryMetrics(builder => {
    builder
        // Configure adapters
        .AddAspNetCoreInstrumentation()
        .AddHttpClientInstrumentation()
        .AddNServiceBusInstrumentation() // Adds NServiceBus instrumentation support
        // Configure exporters
        ; 
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published