RepletoryLib.Tracing
1.0.0
dotnet add package RepletoryLib.Tracing --version 1.0.0
NuGet\Install-Package RepletoryLib.Tracing -Version 1.0.0
<PackageReference Include="RepletoryLib.Tracing" Version="1.0.0" />
<PackageVersion Include="RepletoryLib.Tracing" Version="1.0.0" />
<PackageReference Include="RepletoryLib.Tracing" />
paket add RepletoryLib.Tracing --version 1.0.0
#r "nuget: RepletoryLib.Tracing, 1.0.0"
#:package RepletoryLib.Tracing@1.0.0
#addin nuget:?package=RepletoryLib.Tracing&version=1.0.0
#tool nuget:?package=RepletoryLib.Tracing&version=1.0.0
RepletoryLib.Tracing
OpenTelemetry distributed tracing with Jaeger and OTLP exporter support.
Part of the RepletoryLib ecosystem -- standalone, reusable .NET 10 libraries with zero business logic.
Overview
RepletoryLib.Tracing provides distributed tracing using OpenTelemetry with automatic instrumentation for ASP.NET Core and HTTP client requests. Traces can be exported to Jaeger, OTLP-compatible collectors, or the console.
Key Features
- OpenTelemetry integration -- Industry-standard distributed tracing
- Auto-instrumentation -- ASP.NET Core and HttpClient traces captured automatically
- Multiple exporters -- Console, Jaeger, and OTLP (Jaeger, Grafana Tempo, etc.)
ITracingService-- Start custom activities, add tags, and record exceptions- Configurable sampling -- Control trace sampling ratio
Installation
dotnet add package RepletoryLib.Tracing
Dependencies
| Package | Type |
|---|---|
RepletoryLib.Common |
RepletoryLib |
OpenTelemetry.Extensions.Hosting |
NuGet |
OpenTelemetry.Instrumentation.AspNetCore |
NuGet |
OpenTelemetry.Instrumentation.Http |
NuGet |
OpenTelemetry.Exporter.OpenTelemetryProtocol |
NuGet |
Prerequisites
- Jaeger or OTLP-compatible collector for viewing traces
docker-compose up -d jaeger
# Jaeger UI: http://localhost:16686
Quick Start
using RepletoryLib.Tracing;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRepletoryTracing(builder.Configuration);
{
"Tracing": {
"ServiceName": "MyApp",
"ServiceVersion": "1.0.0",
"Exporter": "OTLP",
"OtlpEndpoint": "http://localhost:4317",
"SamplingRatio": 1.0
}
}
Configuration
TracingOptions
| Property | Type | Default | Description |
|---|---|---|---|
ServiceName |
string |
"RepletoryService" |
Service name in traces |
ServiceVersion |
string |
"1.0.0" |
Service version tag |
Exporter |
TracingExporter |
OTLP |
Console, Jaeger, or OTLP |
JaegerEndpoint |
string? |
null |
Jaeger agent endpoint |
OtlpEndpoint |
string |
"http://localhost:4317" |
OTLP collector endpoint |
SamplingRatio |
double |
1.0 |
Sampling ratio (0.0 to 1.0) |
Usage Examples
Custom Tracing
using RepletoryLib.Tracing.Interfaces;
public class OrderService
{
private readonly ITracingService _tracing;
public OrderService(ITracingService tracing) => _tracing = tracing;
public async Task ProcessOrderAsync(Order order)
{
using var activity = _tracing.StartActivity("ProcessOrder");
_tracing.AddTag("order.id", order.Id.ToString());
_tracing.AddTag("order.total", order.Total.ToString());
try
{
await ValidateOrderAsync(order);
await ChargePaymentAsync(order);
await SendConfirmationAsync(order);
}
catch (Exception ex)
{
_tracing.RecordException(ex);
throw;
}
}
}
Integration with Other RepletoryLib Packages
| Package | Relationship |
|---|---|
RepletoryLib.Common |
Direct dependency |
RepletoryLib.Api.Middleware |
Correlation IDs bridge logging and tracing |
RepletoryLib.Logging |
Trace IDs appear in structured logs |
RepletoryLib.Http.Client |
HTTP client calls are auto-instrumented |
License
This project is licensed under the MIT License.
Copyright (c) 2024-2026 Repletory.
For complete documentation, infrastructure setup, and configuration reference, see the RepletoryLib main repository.
| 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 (>= 1.10.0)
- OpenTelemetry.Exporter.Console (>= 1.10.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.10.0)
- OpenTelemetry.Extensions.Hosting (>= 1.10.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.10.1)
- OpenTelemetry.Instrumentation.Http (>= 1.11.0)
- RepletoryLib.Common (>= 1.0.0)
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.0 | 84 | 3/2/2026 |