ActDim.Observability
1.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ActDim.Observability --version 1.0.2
NuGet\Install-Package ActDim.Observability -Version 1.0.2
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="ActDim.Observability" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ActDim.Observability" Version="1.0.2" />
<PackageReference Include="ActDim.Observability" />
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 ActDim.Observability --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ActDim.Observability, 1.0.2"
#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 ActDim.Observability@1.0.2
#: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=ActDim.Observability&version=1.0.2
#tool nuget:?package=ActDim.Observability&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ActDim.Observability
A lightweight, OpenTelemetry-centric observability library for .NET applications built on top of Microsoft.Extensions.Logging and System.Diagnostics.Activity.
Features
- Zero-Ceremony Developer API: Developers write standard
ILoggercalls andlogger.BeginScope()without needing custom logger interfaces. - DI Decorator (
EventObservabilityLoggerFactory): Transparently decoratesILoggerFactoryvia DI container to injectEventObservabilityBridgefor enriching logs and traces. - Activity & OpenTelemetry Enrichment: Automatically transforms scope objects, DTOs, and structured log parameters into flattened, dotted OpenTelemetry attributes (
user.id,order.price). - Auto Activity Creation on Scope: Automatically starts an
Activityspan onlogger.BeginScope()when no ambient span exists (Activity.Current == null), resolved viaobservability.PushActivitySourceName(...)orEventObservabilityOptions.DefaultActivitySourceName. - Ambient Context Separation:
IAmbientContextserves as a neutral ambient variable store. Only properties explicitly pushed viaIObservabilityContextare exported toActivitytags. - Status & Progress Tracking: First-class support for setting operation status text, icons, and progress percentage (
observability.SetStatus("Downloading", icon: "🚀"),observability.SetProgress(45.5)). - Selective Provider & Scope Suppression: Dynamically suppress console loggers, specific logger providers, or external scope export per async flow (
observability.SuppressConsole(),observability.SuppressProviders("File"),observability.SuppressExternalScopes()). - Provider Alias Resolution: Automatically resolves provider aliases via official .NET
[ProviderAlias]attributes or custom provider mappings.
Installation
Install via the .NET CLI:
dotnet add package ActDim.Observability
Or via Package Manager Console:
Install-Package ActDim.Observability
Registration
Register observability in your IServiceCollection:
services.AddEventObservability(logging =>
{
logging.AddConsole();
}, options =>
{
options.IncludeExternalScopes = false; // Default: false
});
Usage
1. Status & Progress Reporting
var observability = serviceProvider.GetRequiredService<IObservabilityContext>();
using (observability.SetStatus("Downloading Dataset", icon: "🚀"))
using (observability.SetProgress(45.5))
using (observability.Push("priority", "high"))
{
logger.LogInformation("Importing rows into database");
}
2. Selective Provider Suppression
// Suppress Console logger output while preserving Activity traces and other logger sinks
using (observability.SuppressConsole())
{
logger.LogInformation("Log without console output");
}
// Suppress specific providers by alias or name (e.g., "File", "Console")
using (observability.SuppressProviders("File", "Console"))
{
logger.LogInformation("Log without File and Console outputs");
}
Testing & Quality
- Test Suite:
ActDim.Observability.Tests - Total Tests: 28 passed (100% success rate, 0 failed, 0 skipped)
- Target Framework: .NET 10.0
dotnet test Tests/Observability.Tests/ActDim.Observability.Tests.csproj
License
This project is licensed under the MIT License.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ActDim.Practix.Abstractions (>= 1.0.2)
- ActDim.Practix.Common (>= 1.0.2)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.