PostgresStudio.Diagnostics
1.0.1
dotnet add package PostgresStudio.Diagnostics --version 1.0.1
NuGet\Install-Package PostgresStudio.Diagnostics -Version 1.0.1
<PackageReference Include="PostgresStudio.Diagnostics" Version="1.0.1" />
<PackageVersion Include="PostgresStudio.Diagnostics" Version="1.0.1" />
<PackageReference Include="PostgresStudio.Diagnostics" />
paket add PostgresStudio.Diagnostics --version 1.0.1
#r "nuget: PostgresStudio.Diagnostics, 1.0.1"
#:package PostgresStudio.Diagnostics@1.0.1
#addin nuget:?package=PostgresStudio.Diagnostics&version=1.0.1
#tool nuget:?package=PostgresStudio.Diagnostics&version=1.0.1
PostgresStudio.Diagnostics
The diagnostics engine of Postgres Studio
and Marten Studio, as a package of its own with no ASP.NET Core in it: the
health sweep and its checks, the facts they read, IPostgresDiagnostics and its typed, stable-coded read model, and an
opt-in health check built on Microsoft.Extensions.Diagnostics.HealthChecks. It answers "is this database healthy, and what should I look at?" for any host that
registers an NpgsqlDataSource - a worker, a job host, a shared library - without a UI to mount.
Take PostgresStudio.Diagnostics when you want the findings in your own code. Take
PostgresStudio when you want the Blazor UI over the same databases, or
MartenStudio when the application uses Marten; both bring this package with
them, at exactly their own version, and you need not reference it.
dotnet add package PostgresStudio.Diagnostics
It brings Npgsql (floor 8.0.3) and the Microsoft.Extensions.* abstractions it registers into
(DependencyInjection.Abstractions, Logging.Abstractions, Options, Diagnostics.HealthChecks, floor 10.0.0), and
references no ASP.NET Core, Marten, JasperFx or Weasel package. Target framework: net10.0.
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddNpgsqlDataSource(connectionString); // found by itself, as the source "default"
builder.Services.AddPostgresDiagnostics(); // options are validated on start
// ... in a hosted service:
await foreach (PostgresDatabaseRef db in diagnostics.ListDatabasesAsync(ct))
{
PostgresDiagnosticsSnapshot snapshot = await diagnostics.GetSnapshotAsync(db, PostgresDiagnosticsRequest.FindingsOnly, ct);
foreach (PostgresFinding finding in snapshot.Findings.Where(f => f.Severity <= PostgresSeverity.Warning))
{
Console.WriteLine($"{finding.Code} {finding.Severity}: {finding.Title}");
}
}
AddPostgresDiagnostics() is refused in an application that also calls AddPostgresStudio() or AddMartenStudio(): they
register the engine themselves. There are no mutes without a UI, and a finding's studio path is a string relative to a
mount that does not exist here.
The long form - the request and the snapshot, findings and their codes, IncludeActivity, cost, the JSON shape and what it
guarantees - is
docs/diagnostics.md, and a complete worker is
samples/PostgresStudio.Worker.
From 1.0 the package follows Semantic Versioning over the contract in
docs/stability.md: the read model is extend-only,
and a finding's code never changes meaning.
| 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Npgsql (>= 8.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PostgresStudio.Diagnostics:
| Package | Downloads |
|---|---|
|
PostgresStudio
An embeddable Blazor Server admin UI for the PostgreSQL databases an ASP.NET Core application already registers as NpgsqlDataSource. |
GitHub repositories
This package is not used by any popular GitHub repositories.
What changed in each release: https://github.com/lahma/marten-studio/blob/main/CHANGELOG.md