Dloizides.Tracing.Client 1.1.0

dotnet add package Dloizides.Tracing.Client --version 1.1.0
                    
NuGet\Install-Package Dloizides.Tracing.Client -Version 1.1.0
                    
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.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dloizides.Tracing.Client" Version="1.1.0" />
                    
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.1.0
                    
#r "nuget: Dloizides.Tracing.Client, 1.1.0"
                    
#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.1.0
                    
#: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.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Dloizides.Tracing.Client&version=1.1.0
                    
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 (2)

Showing the top 2 NuGet packages that depend on Dloizides.Tracing.Client:

Package Downloads
Bff.AspNetCore

Reusable Backend-For-Frontend engine for ASP.NET Core. Terminates auth server-side: holds OIDC tokens in a Redis-backed session, hands the browser only an opaque httpOnly cookie, and forwards Bearer tokens to downstream services via YARP. Provider-agnostic — targets Keycloak (default, realm-scoped) or a generic OpenIddict provider (/connect/*), selectable per app. Server-side ROPC (Keycloak) or authorization-code + PKCE, silent refresh with a per-session SETNX lock, and CSRF protection. A per-app BFF becomes a ~20-line Program.cs.

Dloizides.ServiceDefaults

Aspire-style service defaults for ASP.NET Core: OpenTelemetry (logging/metrics/tracing) wiring, HTTP resilience + service discovery, standard health-check registration (via ServiceDefaults.HealthChecks), and the platform endpoint map (anonymous /health/live|start|ready Kubernetes probes plus an ACME HTTP-01 no-op). Extracted from ~8 services that had each hand-copied the ServiceDefaults/Extensions.cs; normalizes the PostgressConnection connection-string typo by resolving both the correct (PostgresConnection) and legacy-typo keys.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 531 10/28/2026
1.0.1 543 7/12/2026