BbQ.Outcome.Diagnostics
1.2.0-preview.2
dotnet add package BbQ.Outcome.Diagnostics --version 1.2.0-preview.2
NuGet\Install-Package BbQ.Outcome.Diagnostics -Version 1.2.0-preview.2
<PackageReference Include="BbQ.Outcome.Diagnostics" Version="1.2.0-preview.2" />
<PackageVersion Include="BbQ.Outcome.Diagnostics" Version="1.2.0-preview.2" />
<PackageReference Include="BbQ.Outcome.Diagnostics" />
paket add BbQ.Outcome.Diagnostics --version 1.2.0-preview.2
#r "nuget: BbQ.Outcome.Diagnostics, 1.2.0-preview.2"
#:package BbQ.Outcome.Diagnostics@1.2.0-preview.2
#addin nuget:?package=BbQ.Outcome.Diagnostics&version=1.2.0-preview.2&prerelease
#tool nuget:?package=BbQ.Outcome.Diagnostics&version=1.2.0-preview.2&prerelease
BbQ.Outcome.Diagnostics
Optional adapters over ILogger and System.Diagnostics.Activity. The core Outcome package does not depend on this package, logging, or any telemetry exporter.
Installation
This package ships with the Outcome family under the same outcome-v* version.
dotnet add package BbQ.Outcome.Diagnostics --prerelease
using BbQ.Outcome.Diagnostics;
using System.Diagnostics;
using var source = new ActivitySource("MyApplication.Orders"); // normally application-owned
var observer = new OutcomeObserver<AppError>(logger);
var result = await observer.TraceAsync(source, "CreateOrder",
ct => CreateOrderAsync(command, ct), cancellationToken);
Observe annotates the current activity and returns the original outcome. TraceAsync starts and disposes a child activity only when a listener requests it, and observes that child rather than accidentally changing a parent when no child is created. The caller owns the ActivitySource. Configure OpenTelemetry or another listener/exporter in the application.
Success records outcome.success=true, zero errors, and Ok activity status. Domain failure records false, an error count, and Error status without throwing. Operation cancellation is tagged as cancellation and rethrown without assigning an error status. Unexpected exceptions are rethrown with a generic activity status description and a generic log entry; their exception object, message, and stack are not recorded by this adapter.
Structured logs contain the caller-supplied operation name, success flag, and error count. They never automatically contain success values, error descriptions, metadata, attempted values, or error codes. Use stable, non-sensitive operation names. Activity error codes are opt-in via OutcomeObservationOptions(IncludeErrorCodes: true) and require an explicit IErrorDescriptorProvider<TError>. Code count/length is bounded, but applications must still control cardinality and sensitivity.
There is no implicit retry, exception-to-error conversion, best-effort exception swallowing, or global instrumentation switch. As with Tap, exceptions from application-supplied loggers or descriptor providers remain visible. Heterogeneous outcomes are supported with OutcomeObserver<object?> and the extension overloads.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- BbQ.Outcome (>= 1.2.0-preview.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
-
net8.0
- BbQ.Outcome (>= 1.2.0-preview.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
-
net9.0
- BbQ.Outcome (>= 1.2.0-preview.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.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.2.0-preview.2 | 41 | 9/13/2026 |
| 1.2.0-preview.1 | 55 | 9/13/2026 |