RepletoryLib.Tracing 1.0.0

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

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.

NuGet .NET 10 License: MIT


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 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.0 84 3/2/2026