Dosaic.Extensions.Tracing 1.2.41

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

Dosaic.Extensions.Tracing

Compile-time OpenTelemetry tracing for Dosaic apps, woven by Metalama. No runtime DI, no reflection, no proxies — activities are emitted directly into your methods at build time and feed the shared Dosaic ActivitySource.

Install

<ItemGroup>
  <PackageReference Include="Dosaic.Extensions.Tracing" Version="1.0.0" />
</ItemGroup>

Adding the reference is enough: a transitive Metalama fabric traces your code according to the MSBuild properties below. No code changes required.

Configuration (MSBuild)

Property Default Meaning
DosaicTracingMode AllPublic AllPublic · All · PublicAsync · AttributeOnly
DosaicTracingCaptureArgs None Happy-path argument capture: None · ToString · Json
DosaicTracingCaptureArgsOnError ToString Argument capture applied only when a method throws: None · ToString · Json
DosaicTracingInclude everything Semicolon-separated namespace globs (* = one segment, ** = any)
DosaicTracingExclude nothing Semicolon-separated namespace globs
<PropertyGroup>
  <DosaicTracingMode>AllPublic</DosaicTracingMode>
  <DosaicTracingCaptureArgs>None</DosaicTracingCaptureArgs>
  <DosaicTracingCaptureArgsOnError>Json</DosaicTracingCaptureArgsOnError>
  <DosaicTracingInclude>MyApp.Features.*;MyApp.Services.*</DosaicTracingInclude>
  <DosaicTracingExclude>**.Migrations;**.Generated</DosaicTracingExclude>
</PropertyGroup>

Argument capture on error. Even with DosaicTracingCaptureArgs=None (the default), arguments are captured onto the span when a method throws, controlled by DosaicTracingCaptureArgsOnError (default ToString). When happy-path capture is already on, the error capture is skipped to avoid duplicate tags.

Attributes

  • [Trace] — trace a single method, or every eligible instance method of a class. [Trace(CaptureArgs = ArgCaptureMode.Json)] overrides capture for that target.
  • [NoTrace] — opt a class or method out of automatic tracing.
  • [NoCapture] — opt a single parameter out of argument capture.

Parameters of these types are never captured: CancellationToken, Stream, byte[], ReadOnlyMemory<byte>, IServiceProvider, ClaimsPrincipal, HttpContext, IFormFile.

Enriching the current span

using Dosaic.Extensions.Tracing; adds static extension members to Dosaic.Hosting.Abstractions.Tracing, so you enrich Activity.Current directly off Tracing — no new activity is started:

Tracing.Tag("property.id", id);
Tracing.Event("PropertyLoaded");
Tracing.Error(ex);
Tracing.Link(otherActivityContext);

Tracing.Current returns the ambient activity (or null). All calls are no-ops when no activity is active.

Notes

  • Json capture reuses Dosaic's shared SerializationExtensions.Serialize (System.Text.Json, camelCase, enums as strings, nulls ignored). It is not trimming / Native-AOT safe — prefer ToString under AOT.
  • Argument capture never throws: if serialization fails (e.g. a reference cycle), the tag is set to <ExceptionTypeName> instead. A failed capture can never mask the method's own exception.
  • Span names are TypeName.MethodName; all spans use the shared Dosaic ActivitySource.
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.2.41 106 9/7/2026
1.2.40 141 8/27/2026
1.2.40-alpha.1 64 8/27/2026
1.2.39 106 8/25/2026
1.2.38 122 7/30/2026
1.2.37 120 7/14/2026
1.2.36 120 7/10/2026
1.2.35 151 6/19/2026
1.2.34 132 6/10/2026