Dloizides.Tracing.Client 1.0.1

dotnet add package Dloizides.Tracing.Client --version 1.0.1
                    
NuGet\Install-Package Dloizides.Tracing.Client -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dloizides.Tracing.Client" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dloizides.Tracing.Client" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Dloizides.Tracing.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dloizides.Tracing.Client --version 1.0.1
                    
#r "nuget: Dloizides.Tracing.Client, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dloizides.Tracing.Client@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dloizides.Tracing.Client&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Dloizides.Tracing.Client&version=1.0.1
                    
Install as a Cake Tool

Tracing.Client

Shared distributed tracing configuration with OpenTelemetry for all SaaS services.

Features

  • Auto-instruments ASP.NET Core (inbound HTTP requests)
  • Auto-instruments HttpClient (outbound HTTP calls)
  • Auto-instruments Entity Framework Core (database queries)
  • Auto-instruments MassTransit (RabbitMQ message consumers/publishers)
  • Exports traces via OTLP to Jaeger or any OTLP-compatible backend
  • Configurable sampling rate (100% in dev, 10% in production)
  • W3C TraceContext propagation out of the box
  • Graceful no-op when Jaeger is not running

Quick Start

// In Program.cs (builder phase)
builder.AddTracingDefaults(opts => opts.ServiceName = "IdentityService");

Configuration

Via appsettings.json

{
  "Tracing": {
    "ServiceName": "IdentityService",
    "SamplingRatio": 0.1,
    "OtlpEndpoint": "http://jaeger:4317",
    "InstrumentEfCore": true,
    "InstrumentMassTransit": true,
    "IncludeDbStatements": false
  }
}

Via Environment Variables

Variable Description
Tracing__OtlpEndpoint OTLP endpoint (maps to Tracing:OtlpEndpoint config key)
Tracing__SamplingRatio Sampling ratio (0.0 to 1.0)
Tracing__Enabled Enable/disable tracing entirely

Note: The standard OTEL_EXPORTER_OTLP_ENDPOINT env var is intentionally NOT read by this package to avoid conflicts with .NET Aspire's UseOtlpExporter(). Use Tracing__OtlpEndpoint.

Via Docker Compose

environment:
  - Tracing__OtlpEndpoint=http://jaeger:4317
  - Tracing__SamplingRatio=0.1

Design Decisions

  • No-op when no endpoint: If Tracing:OtlpEndpoint is empty (or the Tracing__OtlpEndpoint env var is unset), traces are collected but not exported. Services start without errors even if Jaeger is down.
  • MassTransit: MassTransit 8.x has built-in OpenTelemetry via System.Diagnostics.Activity. We add its ActivitySource name so the OpenTelemetry SDK captures those spans automatically.
  • Sampling: Defaults to 100% in development. Set to 10% in production via config or env var.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 281 7/12/2026