Dloizides.Tracing.Client
1.0.1
See the version list below for details.
dotnet add package Dloizides.Tracing.Client --version 1.0.1
NuGet\Install-Package Dloizides.Tracing.Client -Version 1.0.1
<PackageReference Include="Dloizides.Tracing.Client" Version="1.0.1" />
<PackageVersion Include="Dloizides.Tracing.Client" Version="1.0.1" />
<PackageReference Include="Dloizides.Tracing.Client" />
paket add Dloizides.Tracing.Client --version 1.0.1
#r "nuget: Dloizides.Tracing.Client, 1.0.1"
#:package Dloizides.Tracing.Client@1.0.1
#addin nuget:?package=Dloizides.Tracing.Client&version=1.0.1
#tool nuget:?package=Dloizides.Tracing.Client&version=1.0.1
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_ENDPOINTenv var is intentionally NOT read by this package to avoid conflicts with .NET Aspire'sUseOtlpExporter(). UseTracing__OtlpEndpoint.
Via Docker Compose
environment:
- Tracing__OtlpEndpoint=http://jaeger:4317
- Tracing__SamplingRatio=0.1
Design Decisions
- No-op when no endpoint: If
Tracing:OtlpEndpointis empty (or theTracing__OtlpEndpointenv 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 | Versions 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. |
-
net10.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.12.0)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.12.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.10.0-beta.1)
- OpenTelemetry.Instrumentation.Http (>= 1.12.0)
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.