AuroraScienceHub.Framework.Diagnostics 10.1.0

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

AuroraScienceHub.Framework.Diagnostics

Diagnostic utilities for .NET applications including health checks, connection string parsing, and application diagnostics.

Overview

Provides essential diagnostic capabilities for monitoring application health, parsing connection strings, tracking application state, and exposing application information.

Key Features

  • Health Check Extensions - Simplified health check registration
  • Connection String Parser - Safe parsing of database connection strings
  • Application Descriptor - Automatic application information tracking (version, instance ID, uptime)
  • Custom Health Checks - Easy creation of custom health checks

Installation

dotnet add package AuroraScienceHub.Framework.Diagnostics

Usage

Application Descriptor

Track application information including version, instance ID, environment, and uptime.

// Register (typically in Program.cs)
builder.Services.AddApplicationDescriptor<Program>();

// Configure Host options in appsettings.json
{
  "Host": {
    "Name": "user-service",
    "Namespace": "production"
  }
}

// Use in your services
public class InfoController : ControllerBase
{
    private readonly IApplicationDescriptor _descriptor;

    public InfoController(IApplicationDescriptor descriptor)
    {
        _descriptor = descriptor;
    }

    [HttpGet("/info")]
    public ApplicationInformation GetInfo()
    {
        return _descriptor.Describe();
        // Returns: InstanceId, ApplicationName, Environment,
        //          Namespace, StartedAt, Version, CommitHash
    }
}

Health Check Setup

builder.Services.AddHealthChecks()
    .AddCheck("self", () => HealthCheckResult.Healthy(), tags: new[] { "live" })
    .AddNpgSql(connectionString, name: "database", tags: new[] { "ready" })
    .AddRedis(redisConnection, name: "cache", tags: new[] { "ready" });

var app = builder.Build();

app.MapHealthChecks("/health/live", new HealthCheckOptions
{
    Predicate = check => check.Tags.Contains("live")
});

app.MapHealthChecks("/health/ready", new HealthCheckOptions
{
    Predicate = check => check.Tags.Contains("ready")
});

Custom Health Check

public class DatabaseHealthCheck : IHealthCheck
{
    private readonly IDbConnection _connection;

    public async Task<HealthCheckResult> CheckHealthAsync(
        HealthCheckContext context,
        CancellationToken ct = default)
    {
        try
        {
            await _connection.OpenAsync(ct);
            return HealthCheckResult.Healthy("Database is accessible");
        }
        catch (Exception ex)
        {
            return HealthCheckResult.Unhealthy("Cannot connect to database", ex);
        }
    }
}

// Register
builder.Services.AddHealthChecks()
    .AddCheck<DatabaseHealthCheck>("database");

Connection String Parser

var parsed = ConnectionStringParser.ParsePostgreSql(connectionString);
Console.WriteLine($"Host: {parsed.Host}");
Console.WriteLine($"Database: {parsed.Database}");
// Password is not exposed for security

ApplicationInformation

The ApplicationInformation record provides comprehensive application metadata:

public record ApplicationInformation(
    string InstanceId,          // Unique instance ID (e.g., "user-service-01234567")
    string ApplicationName,     // Application name from Host config
    string EnvironmentName,     // Environment (Development, Production, etc.)
    string HostNamespace,       // Namespace/cluster from Host config
    DateTimeOffset StartedAt,   // When the application started
    string Version,             // Assembly version
    string? CommitHash          // Git commit hash (if available)
);

Kubernetes Integration

livenessProbe:
  httpGet:
    path: /health/live
    port: 80
readinessProbe:
  httpGet:
    path: /health/ready
    port: 80

License

See LICENSE file in the repository root.

  • AuroraScienceHub.Framework.AspNetCore - ASP.NET Core diagnostic extensions
  • AuroraScienceHub.Framework.Utilities - Host options and configuration
  • AspNetCore.HealthChecks.* - Additional health check providers
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 (3)

Showing the top 3 NuGet packages that depend on AuroraScienceHub.Framework.Diagnostics:

Package Downloads
AuroraScienceHub.Framework.EntityFramework.NpgSql

Entity Framework Core extensions for PostgreSQL with NetTopologySuite spatial support, naming conventions, and database factory patterns.

AuroraScienceHub.Framework.AspNetCore

ASP.NET Core extensions for composition, diagnostics, problem details (RFC 7807), security utilities, and routing enhancements.

AuroraScienceHub.Framework.Logging.OpenTelemetry

OpenTelemetry integration for distributed tracing, metrics, and observability with configuration and diagnostics support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.1.0 144 8/19/2026
10.0.8 129 8/14/2026
10.0.7 113 8/11/2026
10.0.6 114 8/11/2026
10.0.5 2,427 4/23/2026
10.0.4 123 4/23/2026
10.0.3 668 2/11/2026
10.0.2 761 1/29/2026
10.0.1 524 12/25/2025
10.0.0 469 12/11/2025
9.0.7 2,282 11/20/2025
9.0.6 238 11/15/2025
9.0.5 290 11/8/2025
9.0.4 273 10/24/2025
9.0.3 265 10/15/2025
9.0.2 243 10/15/2025
9.0.1 602 10/14/2025
9.0.1-workflow-test-2.17 154 10/14/2025