CoreSystem.Observability.Abstractions
1.1.0
dotnet add package CoreSystem.Observability.Abstractions --version 1.1.0
NuGet\Install-Package CoreSystem.Observability.Abstractions -Version 1.1.0
<PackageReference Include="CoreSystem.Observability.Abstractions" Version="1.1.0" />
<PackageVersion Include="CoreSystem.Observability.Abstractions" Version="1.1.0" />
<PackageReference Include="CoreSystem.Observability.Abstractions" />
paket add CoreSystem.Observability.Abstractions --version 1.1.0
#r "nuget: CoreSystem.Observability.Abstractions, 1.1.0"
#:package CoreSystem.Observability.Abstractions@1.1.0
#addin nuget:?package=CoreSystem.Observability.Abstractions&version=1.1.0
#tool nuget:?package=CoreSystem.Observability.Abstractions&version=1.1.0
🧩 CoreSystem.Observability.Abstractions
Base contracts for health checks and observability contributors in .NET 8, 9 and 10
CoreSystem.Observability.Abstractions defines the extension points that let
CoreSystem modules contribute health checks and OpenTelemetry activity sources
without depending on the observability runtime. It references only
Microsoft.Extensions.Diagnostics.HealthChecks; CoreSystem.Observability
discovers the registered contributors and wires them into the host.
✨ Features
- ✅
IHealthCheckContributorcontract for module health checks - ✅
IObservabilityContributorcontract for activity sources and DI registration - ✅ Decoupled from the OpenTelemetry runtime
- ✅ Contributors are discovered by
CoreSystem.Observabilityfrom dependency injection - ✅ Targets .NET 8, .NET 9 and .NET 10
📦 Installation
dotnet add package CoreSystem.Observability.Abstractions
🚀 Quick Start
Implement a health check contributor:
using Core.Observability.Abstractions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
public sealed class DatabaseHealthCheckContributor : IHealthCheckContributor
{
public void RegisterHealthChecks(
IHealthChecksBuilder builder,
IConfiguration configuration)
{
builder.AddCheck("database", () => HealthCheckResult.Healthy());
}
}
Implement an observability contributor:
using Core.Observability.Abstractions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
public sealed class OrdersObservabilityContributor : IObservabilityContributor
{
public IEnumerable<string> GetActivitySources()
=> ["Orders.Api"];
public void ConfigureObservability(
IServiceCollection services,
IConfiguration configuration)
{
// Register observability services used by the module.
}
}
Register the contributors as instances so CoreSystem.Observability can
discover them:
builder.Services.AddSingleton<IHealthCheckContributor>(
new DatabaseHealthCheckContributor());
builder.Services.AddSingleton<IObservabilityContributor>(
new OrdersObservabilityContributor());
🧩 Contributor Contracts
| Interface | Member | Purpose |
|---|---|---|
IHealthCheckContributor |
RegisterHealthChecks(IHealthChecksBuilder, IConfiguration) |
Adds health checks to the health checks builder. |
IObservabilityContributor |
GetActivitySources() |
Returns the activity source names contributed by the module. |
IObservabilityContributor |
ConfigureObservability(IServiceCollection, IConfiguration) |
Registers observability services in the DI container. |
🏗 How Discovery Works
Contributors are not discovered by scanning assemblies. Each module
registers its contributors as instances in the dependency injection container,
and CoreSystem.Observability reads them when the host is built:
Module
│ services.AddSingleton<IHealthCheckContributor>(new MyContributor())
▼
CoreSystem.Observability
│ reads the IServiceCollection descriptors
▼
Health checks and activity sources registered
Note: discovery looks for registered instances. A type registration such as
AddSingleton<IHealthCheckContributor, MyContributor>()is not picked up.
📖 Documentation
The full documentation includes:
- Architecture overview
- Dependency injection guide
- Package dependency map
Visit the GitHub repository for the complete documentation.
🤝 Contributing
Issues and pull requests are welcome.
📄 License
Released under the MIT License.
| 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
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.32)
- Microsoft.Extensions.Options (>= 8.0.2)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.21)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.21)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.21)
- Microsoft.Extensions.Options (>= 9.0.21)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on CoreSystem.Observability.Abstractions:
| Package | Downloads |
|---|---|
|
CoreSystem.Resilience
Production-ready resilience framework for .NET 8, .NET 9 and .NET 10 with configurable resilience pipelines, Retry, Timeout, Circuit Breaker, and OpenTelemetry metrics. |
|
|
CoreSystem.Idempotency
Production-ready idempotency framework for ASP.NET Core featuring duplicate suppression, request fingerprinting, response replay, OpenTelemetry integration, and a provider-based storage architecture. |
|
|
CoreSystem.RateLimiting
Safe fixed-window rate limiting for ASP.NET Core APIs. |
|
|
CoreSystem.Observability
Standardized observability for .NET 8, .NET 9 and .NET 10 Cloud-Native apps with OpenTelemetry and Serilog. |
|
|
CoreSystem.Idempotency.PostgreSql
Production-ready PostgreSQL storage provider for CoreSystem.Idempotency, providing durable persistence through the IIdempotencyStorage abstraction with Dapper-based data access. Ships an idempotent schema script at scripts/postgres.sql. |
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.2: Dependency refresh. Microsoft.Extensions.Diagnostics.HealthChecks 8.0.28 to 8.0.32. No code or API changes.
1.1.0: targets net8.0, net9.0 and net10.0. No public API or behavior change; the net9.0 and net10.0 assets are new, and the net8.0 asset is unchanged. Microsoft.Extensions.Configuration(.Abstractions), Diagnostics.HealthChecks and Options are declared per TFM (8.0.x / 9.0.21 / 10.0.13).