Atya.Diagnostics.Tracing 1.0.1

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

Atya.Diagnostics.Tracing

Provider-agnostic tracing helpers for .NET applications built on System.Diagnostics.Activity.

Installation

dotnet add package Atya.Diagnostics.Tracing

What This Package Provides

  • DI registration for a package-owned ActivitySource.
  • Convenience methods for internal, client, server, producer, and consumer activities.
  • Common tag helpers for correlation, tenant, user, entity, dependency, messaging, outcomes, and errors.
  • Optional service/default tags applied to package-created activities.
  • Lightweight trace-context snapshots and W3C propagation header helpers.

This package intentionally does not configure OpenTelemetry SDK exporters, logging providers, ASP.NET Core middleware, or vendor-specific integrations.

Quick Start

using Atya.Diagnostics.Tracing.Abstractions;
using Atya.Diagnostics.Tracing.Extensions;

services.AddAtyaTracing(options =>
{
    options.ActivitySourceName = "Orders.Service";
    options.ActivitySourceVersion = "1.0.0";
    options.ServiceName = "Orders.Service";
    options.ServiceVersion = "1.0.0";
    _ = options.AddDefaultTag("deployment.environment", "production");
});

public sealed class OrderProcessor(IActivitySourceAccessor activitySource)
{
    public void Process(int orderId)
    {
        using var activity = activitySource.StartInternalActivity("orders.process");

        _ = activity?
            .SetOperationName("ProcessOrder")
            .SetEntity("Order", orderId)
            .MarkSuccess();
    }
}

Propagation

var snapshot = TraceContextSnapshot.CaptureCurrent();

if (snapshot is not null)
{
    var headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
    snapshot.WriteTo(headers);
}

Use snapshot.TryGetActivityContext(out var context) to recreate an ActivityContext from a captured W3C traceparent value.

Error Handling

MarkError(Exception) sets ActivityStatusCode.Error, outcome=error, error.type, and error.message when an exception has a non-empty message. MarkSuccess() sets ActivityStatusCode.Ok and outcome=success.

Compatibility

This package targets net10.0.

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 (1)

Showing the top 1 NuGet packages that depend on Atya.Diagnostics.Tracing:

Package Downloads
Atya.Diagnostics.Observation

Thin diagnostics composition package over logging, tracing, and metrics.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 502 5/25/2026
1.0.0 222 5/23/2026